/* RushDrama · Tanpa Iklan — tema gelap, mobile-first, tanpa aset eksternal */
:root {
  --bg: #0b0f19;
  --bg-2: #121826;
  --bg-3: #1a2234;
  --line: #26314a;
  --text: #e8edf8;
  --muted: #9aa7c2;
  --accent: #5b8cff;
  --accent-2: #7c5cff;
  --danger: #ff6b6b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 44px rgba(0, 0, 0, .45);
  --header-h: 60px;
  --tabbar-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

html[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-2: #ffffff;
  --bg-3: #eef2f9;
  --line: #d8e0ee;
  --text: #101728;
  --muted: #5b6880;
  --shadow: 0 18px 44px rgba(16, 23, 40, .12);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body.rd {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b));
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; min-height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  font-weight: 800; color: #fff; font-size: 16px;
}
.brand-text { font-weight: 700; letter-spacing: -.2px; font-size: 15px; }
.brand-text b { color: var(--accent); }
.badge-free {
  font-size: 9.5px; font-weight: 800; letter-spacing: .8px;
  padding: 2px 6px; border-radius: 6px;
  background: rgba(91, 140, 255, .16); color: var(--accent);
  border: 1px solid rgba(91, 140, 255, .35);
}

.searchbox { position: relative; flex: 1 1 auto; max-width: 460px; min-width: 0; display: flex; }
.searchbox input {
  flex: 1 1 0%; width: 0; min-width: 0;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 999px 0 0 999px; padding: 9px 14px; outline: none;
}
.searchbox input:focus { border-color: var(--accent); }
.searchbox button {
  background: var(--accent); border: 0; color: #fff; font-weight: 600;
  padding: 0 16px; border-radius: 0 999px 999px 0; cursor: pointer;
}
.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  overflow: hidden; z-index: 70; max-height: 60vh; overflow-y: auto;
}
.search-dropdown a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; }
.search-dropdown a:hover, .search-dropdown a:focus { background: var(--bg-3); }
.search-dropdown img { width: 34px; height: 46px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; }
.search-dropdown .sd-title { font-size: 13.5px; line-height: 1.3; }
.search-dropdown .sd-empty { padding: 12px; color: var(--muted); font-size: 13px; }

.menu { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.menu > a, .menu summary {
  padding: 7px 10px; border-radius: 9px; font-size: 13.5px;
  color: var(--muted); cursor: pointer; white-space: nowrap;
  list-style: none; user-select: none;
}
.menu summary::-webkit-details-marker { display: none; }
.menu > a:hover, .menu summary:hover, .menu > a.active { background: var(--bg-3); color: var(--text); }
.menu > a.active { color: var(--accent); }

.drop { position: relative; }
.drop-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 8px; min-width: 230px;
  max-height: min(70vh, 520px); overflow-y: auto; z-index: 70;
  display: grid; gap: 1px;
}
.drop-panel a { padding: 7px 9px; border-radius: 7px; font-size: 13px; color: var(--muted); }
.drop-panel a:hover, .drop-panel a.active { background: var(--bg-3); color: var(--text); }

.icon-btn {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  width: 36px; height: 36px; display: grid; place-items: center;
  cursor: pointer; flex: 0 0 auto;
}
.icon-btn:hover { border-color: var(--accent); }
.bars { width: 15px; height: 2px; background: currentColor; position: relative; display: block; }
.bars::before, .bars::after {
  content: ""; position: absolute; left: 0; width: 15px; height: 2px; background: currentColor;
}
.bars::before { top: -5px; }
.bars::after { top: 5px; }

/* ---------------------------------------------------------------- drawer */
.drawer { position: fixed; inset: 0; z-index: 90; background: rgba(4, 7, 14, .62); }
.drawer[hidden] { display: none; }
.drawer-panel {
  position: absolute; inset: 0 auto 0 0; width: min(86vw, 340px);
  background: var(--bg-2); border-right: 1px solid var(--line);
  padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 700; }
.drawer-panel > a { padding: 10px 8px; border-radius: 9px; font-size: 14.5px; }
.drawer-panel > a:hover { background: var(--bg-3); }
.drawer-section { margin: 12px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px; padding: 5px 9px; border-radius: 999px;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--muted);
}
.chip.active, .chip:hover { color: var(--text); border-color: var(--accent); }

/* ------------------------------------------------------------------ wrap */
.wrap { max-width: 1280px; margin: 0 auto; padding: 16px 14px 40px; }

.section-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 18px 0 12px; }
.section-head h1, .section-head h2 { font-size: 19px; margin: 0; letter-spacing: -.3px; }
.section-head .muted { font-size: 12.5px; }

/* ------------------------------------------------------------------ hero */
.hero { margin: 6px -14px 8px; }
.hero-track {
  display: flex; gap: 12px; overflow-x: auto; padding: 6px 14px 14px;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.hero-track::-webkit-scrollbar { display: none; }
.hero-card {
  flex: 0 0 min(560px, 86vw); scroll-snap-align: start;
  display: grid; grid-template-columns: 104px 1fr; gap: 12px;
  background: linear-gradient(160deg, var(--bg-2), var(--bg-3));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; min-height: 160px;
}
.hero-art img { width: 100%; height: 100%; max-height: 160px; object-fit: cover; border-radius: var(--radius-sm); }
.hero-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hero-body h2 { font-size: 16px; margin: 0; line-height: 1.3; }
.facts { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; }
.facts span {
  font-size: 10.5px; padding: 2px 7px; border-radius: 999px;
  background: rgba(91, 140, 255, .14); color: var(--accent);
}
.desc {
  margin: 0; font-size: 12.5px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.btn-play {
  align-self: flex-start; margin-top: auto;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 600; font-size: 13px;
  padding: 8px 14px; border-radius: 999px; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-play:hover { filter: brightness(1.08); }
.btn-ghost {
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  padding: 7px 12px; border-radius: 999px; font-size: 12.5px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
.btn-ghost:hover { border-color: var(--accent); }

/* ------------------------------------------------------------------ grid */
.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}
.card { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.poster-wrap {
  position: relative; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--bg-3); aspect-ratio: 3 / 4; border: 1px solid var(--line);
}
.poster-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.card:hover .poster-wrap img { transform: scale(1.04); }
.poster-fallback {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-size: 34px; font-weight: 800; color: var(--muted);
  background: linear-gradient(150deg, var(--bg-3), var(--bg-2));
}
.ep-badge {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px;
  background: rgba(4, 7, 14, .78); color: #fff;
}
.card-play {
  position: absolute; inset: auto 6px 6px auto;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(4, 7, 14, .72); color: #fff;
  display: grid; place-items: center; font-size: 10px; opacity: 0; transition: opacity .2s;
}
.card:hover .card-play { opacity: 1; }
.card-body h3 {
  margin: 0; font-size: 13px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-tags { margin: 0; font-size: 11px; color: var(--muted); }

.empty {
  padding: 30px 16px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius);
}

/* ----------------------------------------------------------------- pager */
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 26px 0 8px; flex-wrap: wrap; }
.pager-link {
  padding: 8px 14px; border-radius: 999px; font-size: 13px;
  background: var(--bg-2); border: 1px solid var(--line);
}
.pager-link:hover { border-color: var(--accent); }
.pager-link.disabled { opacity: .4; pointer-events: none; }
.pager-text { font-size: 12.5px; color: var(--muted); }

/* ----------------------------------------------------------------- watch */
.watch { display: flex; flex-direction: column; gap: 14px; }
.player-shell {
  background: #000; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.player-stage {
  position: relative; background: #000;
  aspect-ratio: var(--player-ar, 16 / 9);
  max-height: 78vh;
  display: grid; place-items: center;
}
.player-stage video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  background: #000; display: block; object-fit: contain;
}
/* Drama vertikal: panggung dipersempit & ditengahkan, bukan melebar 16:9 */
.player-stage.is-portrait {
  width: var(--player-w, 100%);
  margin-inline: auto;
}
.player-stage:fullscreen { aspect-ratio: auto; height: 100%; }
.player-stage:fullscreen video { height: 100%; }
.player-shell:fullscreen {
  display: flex; flex-direction: column; border-radius: 0; border: 0;
  width: 100%; height: 100%;
}
.player-shell:fullscreen .player-stage { flex: 1 1 auto; aspect-ratio: auto; min-height: 0; }
.player-shell:fullscreen .player-controls { background: rgba(10, 14, 24, .96); }

.player-badge {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  font-size: 9.5px; font-weight: 800; letter-spacing: .7px;
  padding: 3px 7px; border-radius: 6px;
  background: rgba(91, 140, 255, .9); color: #fff;
}
.player-loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 13px; z-index: 4;
}
.player-loading[hidden] { display: none; }

.player-error {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; gap: 10px;
  align-items: center; justify-content: center; text-align: center;
  background: rgba(0, 0, 0, .82); color: #fff; padding: 16px;
}
.player-error[hidden] { display: none; }
.player-error p { margin: 0; font-size: 13.5px; max-width: 460px; }
.error-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.center-play {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center;
  background: rgba(0, 0, 0, .28); cursor: pointer;
}
.center-play[hidden] { display: none; }
.center-play span {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(91, 140, 255, .92); color: #fff;
  display: grid; place-items: center; font-size: 22px; padding-left: 4px;
}

.next-toast {
  position: absolute; inset: auto 12px 12px 12px; z-index: 5;
  background: rgba(10, 14, 24, .94); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px;
  display: flex; flex-direction: column; gap: 9px; align-items: center;
}
.next-toast[hidden] { display: none; }
.next-toast p { margin: 0; font-size: 13px; }

.player-controls {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; background: var(--bg-2);
  border-top: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.player-controls::-webkit-scrollbar { display: none; }
.ctl {
  background: transparent; border: 1px solid transparent; color: var(--text);
  min-width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  display: grid; place-items: center; font-size: 13px; flex: 0 0 auto;
}
.ctl:hover { background: var(--bg-3); }
.ctl.primary { background: var(--accent); color: #fff; }
.ctl.primary:hover { filter: brightness(1.1); }
.ctl.select { padding: 0 6px; background: var(--bg-3); font-size: 12px; }
.ctl:disabled { opacity: .35; cursor: not-allowed; }
.time { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.seek { flex: 1 1 120px; min-width: 80px; accent-color: var(--accent); }
.volume { width: 62px; flex: 0 0 auto; accent-color: var(--accent); }

.watch-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.watch-head h1 { font-size: 20px; margin: 0 0 6px; line-height: 1.25; letter-spacing: -.3px; }
.watch-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.pill {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: rgba(91, 140, 255, .16); color: var(--accent);
  border: 1px solid rgba(91, 140, 255, .3);
}
.pill.ghost { background: var(--bg-2); color: var(--muted); border-color: var(--line); }
.pill.ghost:hover { color: var(--text); border-color: var(--accent); }
.explain-link { font-size: 12px; }

.watch-layout { display: grid; gap: 14px; grid-template-columns: 1fr; }
.panel {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
}
.panel h2 { font-size: 14.5px; margin: 0 0 8px; }
.synopsis { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.65; }

.ep-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.ep-head h2 { font-size: 14.5px; margin: 0; }
.ep-nav { display: flex; gap: 6px; }
.ep-grid {
  display: grid; gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  max-height: 320px; overflow-y: auto; padding-right: 2px;
}
.ep-item {
  text-align: center; padding: 8px 4px; border-radius: 9px; font-size: 12.5px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--muted);
}
.ep-item:hover { border-color: var(--accent); color: var(--text); }
.ep-item.active {
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #fff; border-color: transparent; font-weight: 700;
}
.ep-item.disabled { opacity: .4; pointer-events: none; }
.ep-item[data-ad-group] { position: relative; }
.ep-item[data-ad-group]::after {
  content: ""; position: absolute; top: 4px; right: 4px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--danger);
  opacity: .75;
}

.stat-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.stat-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.stat-list span { color: var(--muted); }
.stat-list b { font-weight: 600; }

.related { margin-top: 22px; }

/* ------------------------------------------------------------------- ads */
.explain-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.code {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 12px; overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent);
}
.inline-form { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.inline-form input {
  flex: 1 1 180px; min-width: 0; background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; outline: none;
}
.inline-form button {
  background: var(--accent); border: 0; color: #fff; font-weight: 600;
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
}

/* ------------------------------------------------------ rail & provider */
.rail-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 0 0 10px; flex-wrap: wrap;
}
.rail-head h2 { font-size: 16px; margin: 0; letter-spacing: -.2px; }
.rail-nav { display: flex; gap: 6px; }

.history-rail, .provider-strip { margin: 16px 0 8px; }
.history-rail[hidden] { display: none; }
.rail-track {
  display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px;
  scroll-snap-type: x proximity; scrollbar-width: thin;
}
.mini-card {
  flex: 0 0 148px; scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 6px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); overflow: hidden; padding-bottom: 8px;
}
.mini-card:hover { border-color: var(--accent); }
.mini-poster { position: relative; aspect-ratio: 3 / 4; background: var(--bg-3); }
.mini-poster img { width: 100%; height: 100%; object-fit: cover; }
.mini-ep {
  position: absolute; inset: auto 6px 6px auto;
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px;
  background: rgba(4, 7, 14, .8); color: #fff;
}
.mini-body { padding: 0 8px; min-width: 0; }
.mini-body h3 {
  margin: 0; font-size: 12.5px; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mini-body p { margin: 2px 0 0; }

.history-actions { display: flex; gap: 8px; margin: 0 0 14px; }
.history-row { display: flex; gap: 6px; margin-top: 4px; }

.provider-bar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.provider-tabs {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: thin;
}
.ptab {
  flex: 0 0 auto; font-size: 12.5px; padding: 6px 12px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--muted);
  white-space: nowrap;
}
.ptab:hover { color: var(--text); border-color: var(--accent); }
.ptab.active {
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #fff; font-weight: 600;
}
.provider-search { display: flex; max-width: 460px; }
.provider-search input {
  flex: 1 1 auto; min-width: 0; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 999px 0 0 999px;
  padding: 8px 14px; outline: none;
}
.provider-search input:focus { border-color: var(--accent); }
.provider-search button {
  background: var(--accent); border: 0; color: #fff; font-weight: 600;
  padding: 0 16px; border-radius: 0 999px 999px 0; cursor: pointer;
}
.provider-rail { margin: 18px 0; }
.provider-rail .tiny { margin: 8px 0 0; }
.chips .chip.more { color: var(--accent); border-color: rgba(91, 140, 255, .45); }

/* ---------------------------------------------------------------- footer */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); margin-top: 30px; padding: 22px 14px; }
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; gap: 20px; justify-content: space-between; flex-wrap: wrap;
}
.footer-inner p { margin: 6px 0 0; font-size: 12.5px; max-width: 560px; }
.footer-links { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.footer-links a:hover { color: var(--accent); }
.footer > .tiny { max-width: 1280px; margin: 12px auto 0; }

/* ---------------------------------------------------------------- tabbar */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 55;
  background: color-mix(in srgb, var(--bg-2) 94%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex; padding-bottom: var(--safe-b);
}
.tabbar a {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 0 6px; font-size: 10.5px; color: var(--muted);
}
.tabbar a.active { color: var(--accent); }
.tab-ico { font-size: 16px; line-height: 1; }

.only-mobile { display: none; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .menu { display: none; }
  .only-desktop { display: none !important; }
  .only-mobile { display: grid; }
  .tabbar { display: flex; }
  .wrap { padding: 12px 12px 30px; }
  .hero { margin-left: -12px; margin-right: -12px; }
  .hero-track { padding-left: 12px; padding-right: 12px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
  .watch-head h1 { font-size: 17px; }
  .ep-grid { max-height: 260px; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
  .volume { display: none; }
  .mini-card { flex-basis: 128px; }
  .rail-head h2 { font-size: 15px; }
}

@media (min-width: 901px) {
  .tabbar { display: none; }
  body.rd { padding-bottom: 0; }
  .watch-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .explain-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-card { grid-template-columns: 128px 1fr; }
  .hero-body h2 { font-size: 18px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .ep-grid { max-height: 420px; }
}

@media (min-width: 1100px) {
  .watch-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 420px) {
  .brand-text { display: none; }
  .badge-free { display: none; }
  .player-controls { gap: 3px; padding: 6px 6px; }
  .ctl { min-width: 30px; height: 30px; }
  .time { font-size: 10.5px; }
  .mini-card { flex-basis: 116px; }
  .provider-search { max-width: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* fullscreen: player mengisi layar, kontrol menempel di bawah */
.player-stage:fullscreen .player-badge { top: 14px; right: 14px; }

/* ---------------------------------------------- responsive refinements */
.explain-grid > *, .watch-layout > *, .panel { min-width: 0; }
.code { max-width: 100%; white-space: pre; }
.panel p, .panel li { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .player-controls { flex-wrap: wrap; overflow-x: visible; row-gap: 8px; padding: 8px; }
  .player-controls .seek { order: -1; flex: 1 1 100%; min-width: 0; }
  .player-controls .volume { display: none; }
  .player-controls .time { margin-right: auto; }
  .ctl.select { max-width: 64px; }
}
