/* ============================================================
   CINEBOX - Tema escuro cinematográfico
   ============================================================ */

:root {
  --bg:            #08090d;
  --bg-elev:       #101219;
  --bg-elev-2:     #171a23;
  --surface:       rgba(255,255,255,.055);
  --surface-hover: rgba(255,255,255,.11);
  --border:        rgba(255,255,255,.10);
  --border-strong: rgba(255,255,255,.20);

  --text:          #f4f5f8;
  --text-dim:      #a3a9b8;
  --text-faint:    #6b7284;

  --accent:        #ff2d55;
  --accent-2:      #ff6b3d;
  --accent-soft:   rgba(255,45,85,.16);
  --cyan:          #22d3ee;
  --ok:            #34d399;

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 16px;
  --r-xl: 24px;

  --shadow:    0 10px 40px rgba(0,0,0,.55);
  --shadow-lg: 0 24px 70px rgba(0,0,0,.7);

  --topbar-h: 64px;
  --rail-w:   230px;
  --ease:     cubic-bezier(.22,.61,.36,1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* O atributo [hidden] precisa vencer os display: flex/grid dos componentes
   (tela de boot, modal, player). Sem isso o overlay de carregamento e o
   modal ficam sempre visiveis por cima do app. */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1,h2,h3,h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.3); background-clip: padding-box; }

/* ============================================================
   BOOT
   ============================================================ */
.boot {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px;
  background: radial-gradient(1200px 600px at 50% 30%, #16192a 0%, var(--bg) 70%);
}
.boot__logo { font-size: clamp(32px, 7vw, 58px); font-weight: 900; letter-spacing: -.04em; }
.boot__mark { color: #fff; }
.boot__mark--accent {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.boot__bar { width: min(280px, 70vw); height: 3px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.boot__bar i { display: block; height: 100%; width: 38%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); animation: bootSlide 1.1s var(--ease) infinite; }
@keyframes bootSlide { 0% { transform: translateX(-100%);} 100% { transform: translateX(360%);} }
.boot__msg { color: var(--text-dim); font-size: 14px; margin: 0; }

/* ============================================================
   TOPBAR
   ============================================================ */
.app { min-height: 100%; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 26px;
  padding: 0 clamp(14px, 3vw, 40px);
  background: linear-gradient(180deg, rgba(8,9,13,.96) 0%, rgba(8,9,13,.72) 70%, transparent 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background .25s, border-color .25s;
}
.topbar--solid {
  background: rgba(8,9,13,.96);
  border-bottom: 1px solid var(--border);
}
.topbar__brand { display: flex; font-size: 21px; font-weight: 900; letter-spacing: -.04em; flex: 0 0 auto; }
.topbar__mark { color: #fff; }
.topbar__mark--accent {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar__nav { display: flex; gap: 4px; flex: 1 1 auto; overflow: hidden; }
.topbar__nav a {
  padding: 8px 14px; border-radius: var(--r-sm);
  color: var(--text-dim); font-weight: 600; font-size: 14.5px;
  white-space: nowrap; transition: color .18s, background .18s;
}
.topbar__nav a:hover { color: var(--text); background: var(--surface); }
.topbar__nav a.is-active { color: #fff; }
.topbar__right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.iconbtn {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: var(--text-dim);
  transition: background .18s, color .18s, transform .18s;
}
.iconbtn:hover { background: var(--surface-hover); color: #fff; }
.iconbtn:active { transform: scale(.93); }
.iconbtn.is-busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* busca */
.search {
  position: relative; display: flex; align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  height: 40px; padding: 0 12px;
  transition: border-color .2s, background .2s, width .25s;
  width: 44px;
}
.search:focus-within { border-color: var(--border-strong); background: rgba(255,255,255,.09); width: 260px; }
.search__icon { width: 18px; height: 18px; flex: 0 0 auto; color: var(--text-dim); cursor: pointer; }
.search input {
  border: 0; background: none; outline: none; color: var(--text);
  width: 0; padding: 0; transition: width .25s; font-size: 14.5px;
}
.search:focus-within input { width: 210px; padding-left: 10px; }
.search input::-webkit-search-cancel-button { display: none; }
.search__clear { display: none; color: var(--text-dim); font-size: 20px; line-height: 1; padding: 0 2px; }
.search:focus-within .search__clear { display: block; }

/* ============================================================
   DRAWER
   ============================================================ */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; right: -340px; left: auto; bottom: 0; z-index: 90;
  width: min(320px, 84vw);
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  direction: ltr;
  transition: right .4s var(--ease);
  display: flex; flex-direction: column;
  padding: 18px;
}
.drawer.is-open { right: 0; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.drawer__mark { font-size: 20px; font-weight: 900; letter-spacing: -.04em; }
.drawer__mark span {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.drawer__links { display: flex; flex-direction: column; gap: 2px; }
.drawer__links a {
  padding: 11px 14px; border-radius: var(--r); color: var(--text-dim);
  font-weight: 600; transition: background .18s, color .18s;
}
.drawer__links a:hover, .drawer__links a.is-active { background: var(--surface); color: #fff; }
.drawer__foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--border); }
.drawer__label { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--text-faint); margin: 0 0 10px; font-weight: 700; }
.drawer__urls { display: flex; flex-direction: column; gap: 6px; }
.drawer__urls a {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px; color: var(--cyan);
  padding: 7px 10px; border-radius: var(--r-sm); background: var(--surface);
  word-break: break-all;
}
.drawer__urls a:hover { background: var(--surface-hover); }
.drawer__note { font-size: 12px; color: var(--text-faint); margin: 12px 0 0; line-height: 1.45; }

/* ============================================================
   VIEWS / GRID
   ============================================================ */
.views { flex: 1 1 auto; padding-bottom: 60px; }
.view { animation: viewIn .32s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

.view__head {
  display: flex; align-items: baseline; gap: 14px;
  padding: 26px clamp(14px, 3vw, 40px) 14px;
}
.view__title { font-size: clamp(22px, 3.4vw, 32px); }
.view__count { color: var(--text-faint); font-size: 14px; }
.view__sub { color: var(--text-dim); font-size: 14.5px; margin: -6px clamp(14px, 3vw, 40px) 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--rail-w), 1fr));
  gap: clamp(14px, 1.6vw, 22px);
  padding: 8px clamp(14px, 3vw, 40px);
}

/* ---- card ---- */
.card {
  position: relative;
  display: block;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-elev);
  aspect-ratio: 2 / 3;
  cursor: pointer;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  outline: none;
}
.card:hover, .card:focus-visible {
  transform: translateY(-6px) scale(1.025);
  box-shadow: var(--shadow-lg);
  z-index: 3;
}
.card--wide { aspect-ratio: 16 / 9; }
.card__art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--bg-elev-2); }
.card__ph {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px;
  background: linear-gradient(150deg, var(--ph1, #2a2f45), var(--ph2, #14161f));
}
.card__ph::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 20% 0%, rgba(255,255,255,.14), transparent 60%);
}
.card__phTitle {
  position: relative; z-index: 1;
  font-weight: 700; font-size: 15px; line-height: 1.25;
  text-shadow: 0 2px 10px rgba(0,0,0,.7);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.card__phMark {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  font-size: 10px; font-weight: 800; letter-spacing: .16em;
  color: rgba(255,255,255,.5);
}
.card__grad { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.92) 0%, rgba(0,0,0,.35) 42%, transparent 72%); }
.card__body { position: absolute; inset: auto 0 0 0; padding: 12px 13px; z-index: 2; }
.card__title {
  font-weight: 700; font-size: 15px; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 2px 8px rgba(0,0,0,.8);
}
.card__meta { display: flex; align-items: center; gap: 7px; margin-top: 5px; font-size: 12px; color: var(--text-dim); }
.card__meta i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }
.card__badges { position: absolute; top: 10px; left: 10px; z-index: 3; display: flex; gap: 5px; flex-wrap: wrap; max-width: calc(100% - 20px); }
.badge {
  font-size: 10px; font-weight: 800; letter-spacing: .06em;
  padding: 3px 7px; border-radius: 4px;
  background: rgba(0,0,0,.72); color: #fff; backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.14);
}
.badge--hd { background: rgba(255,255,255,.92); color: #101219; border-color: transparent; }
.badge--4k { background: rgba(255,255,255,.14); }
.badge--fav { background: var(--accent); border-color: transparent; }
.badge--play { background: rgba(0,0,0,.7); }
.card__prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3.5px; background: rgba(255,255,255,.18); z-index: 3; }
.card__prog i { display: block; height: 100%; background: var(--accent); }
.card__resume {
  position: absolute; right: 10px; bottom: 10px; z-index: 3;
  background: rgba(0,0,0,.78); border-radius: 50%;
  width: 34px; height: 34px; display: grid; place-items: center;
  backdrop-filter: blur(6px);
}
.card__resume svg { width: 15px; height: 15px; fill: #fff; stroke: none; }
.card__fav {
  position: absolute; top: 8px; right: 8px; z-index: 4;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0,0,0,.6); backdrop-filter: blur(6px);
  opacity: 0; transform: scale(.85);
  transition: opacity .2s, transform .2s;
}
.card:hover .card__fav, .card__fav:focus-visible { opacity: 1; transform: none; }
.card__fav svg { width: 16px; height: 16px; }
.card__fav.is-on svg { fill: var(--accent); stroke: var(--accent); }
.card__fav.is-on { opacity: 1; }

/* ---- rails ---- */
.rail { margin: 30px 0 8px; }
.rail__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(14px, 3vw, 40px) 12px;
}
.rail__title { font-size: clamp(17px, 2.2vw, 22px); }
.rail__more { color: var(--text-dim); font-size: 13.5px; font-weight: 600; }
.rail__more:hover { color: #fff; }
.rail__track {
  display: flex; gap: clamp(10px, 1.1vw, 16px);
  overflow-x: auto; overflow-y: hidden;
  padding: 6px clamp(14px, 3vw, 40px) 18px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.rail__track::-webkit-scrollbar { height: 6px; }
.rail__item { flex: 0 0 var(--rail-w); scroll-snap-align: start; }
.rail__item--wide { flex-basis: 320px; }

/* ---- hero ---- */
.hero {
  position: relative;
  min-height: clamp(340px, 52vh, 600px);
  display: flex; align-items: flex-end;
  padding: clamp(24px, 4vw, 64px);
  overflow: hidden;
  margin-bottom: 8px;
}
.hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(8,9,13,.96) 0%, rgba(8,9,13,.72) 42%, rgba(8,9,13,.15) 78%),
    linear-gradient(0deg, var(--bg) 2%, transparent 55%);
}
.hero__inner { position: relative; z-index: 2; max-width: 640px; }
.hero__eyebrow { color: var(--accent); font-weight: 800; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; margin: 0 0 10px; }
.hero__title { font-size: clamp(30px, 5.6vw, 62px); line-height: 1.02; letter-spacing: -.035em; margin-bottom: 12px; }
.hero__meta { display: flex; align-items: center; gap: 9px; color: var(--text-dim); font-size: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.hero__meta i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .55; }
.hero__desc { color: #d6dae4; font-size: 15.5px; line-height: 1.6; margin: 0 0 24px; max-width: 560px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 26px; border-radius: 99px;
  font-weight: 700; font-size: 15px;
  background: #fff; color: #0b0d13;
  transition: transform .16s var(--ease), background .18s, opacity .18s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); background: #e9ebf0; }
.btn:active { transform: scale(.97); }
.btn svg { width: 19px; height: 19px; }
.btn--play svg { fill: currentColor; stroke: none; }
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: #ff4166; }
.btn--ghost { background: rgba(255,255,255,.14); color: #fff; backdrop-filter: blur(10px); }
.btn--ghost:hover { background: rgba(255,255,255,.24); }
.btn--sm { padding: 8px 16px; font-size: 13.5px; }
.btn--icon { padding: 12px; border-radius: 50%; }

/* ---- empty / loading ---- */
.empty { text-align: center; padding: 80px 20px; color: var(--text-dim); }
.empty__icon { font-size: 52px; margin-bottom: 14px; opacity: .5; }
.empty h3 { color: var(--text); font-size: 20px; margin-bottom: 8px; }
.empty p { margin: 0 auto; max-width: 460px; line-height: 1.6; }
.empty code {
  display: inline-block; margin-top: 12px; padding: 8px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; color: var(--cyan);
}
.skel { background: linear-gradient(100deg, #171a23 30%, #212533 50%, #171a23 70%); background-size: 220% 100%; animation: shimmer 1.3s infinite; border-radius: var(--r-lg); aspect-ratio: 2/3; }
@keyframes shimmer { to { background-position: -120% 0; } }

/* ============================================================
   MODAL
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center; padding: 20px; }
.modal__scrim { position: absolute; inset: 0; background: rgba(0,0,0,.78); backdrop-filter: blur(6px); animation: fade .2s; }
.modal__panel {
  position: relative; z-index: 1;
  width: min(940px, 100%); max-height: 90vh; overflow: auto;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  animation: modalIn .3s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(14px); } }
.modal__close {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; font-size: 24px; line-height: 1;
  display: grid; place-items: center; backdrop-filter: blur(8px);
  transition: background .18s;
}
.modal__close:hover { background: rgba(0,0,0,.85); }
.modal__hero { position: relative; }
.modal__hero img { width: 100%; max-height: 420px; object-fit: cover; }
.modal__heroVeil { position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg-elev) 3%, transparent 62%); }
.modal__heroBody { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px clamp(20px, 3vw, 34px); }
.modal__title { font-size: clamp(22px, 3.6vw, 34px); margin-bottom: 12px; }
.modal__meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; color: var(--text-dim); font-size: 14px; margin-bottom: 16px; }
.modal__meta i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .55; }
.modal__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.modal__section { padding: 22px clamp(20px, 3vw, 34px); }
.modal__section h4 { font-size: 16px; margin-bottom: 10px; }
.modal__desc { color: #d3d8e3; line-height: 1.65; font-size: 15px; margin: 0; }
.modal__tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.tag {
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  padding: 5px 10px; border-radius: 5px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
}
.modal__cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 26px; }
.spec { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.spec span:first-child { color: var(--text-faint); }
.spec span:last-child { color: var(--text); text-align: right; word-break: break-word; }

/* temporada / episodio */
.season { margin-bottom: 22px; }
.season__head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; cursor: pointer; user-select: none; padding: 4px 8px; border-radius: var(--r-sm); transition: background .16s; }
.season__head:hover { background: var(--surface-hover); }
.season__name { font-size: 17px; }
.season__count { color: var(--text-faint); font-size: 13px; }
.season__toggle { margin-left: auto; font-size: 12px; color: var(--text-dim); transition: transform .3s ease; }
.season__toggle.collapsed { transform: rotate(-90deg); }
.season__eps {
  max-height: 5000px;
  overflow: hidden;
  transition: max-height .4s cubic-bezier(.4,0,.2,1), opacity .25s ease, margin-bottom .3s ease;
  opacity: 1;
  margin-bottom: 16px;
}
.season__eps.collapsed {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}
.ep {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 11px; border-radius: var(--r);
  cursor: pointer; transition: background .18s;
  border: 1px solid transparent;
}
.ep:hover, .ep:focus-visible { background: var(--surface); border-color: var(--border); }
.ep__num {
  flex: 0 0 42px; height: 42px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--bg-elev-2); font-weight: 800; font-size: 15px; color: var(--text-dim);
}
.ep__body { flex: 1 1 auto; min-width: 0; }
.ep__title { font-weight: 700; font-size: 14.5px; margin-bottom: 3px; }
.ep__desc { font-size: 13px; color: var(--text-dim); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep__thumb { flex: 0 0 116px; aspect-ratio: 16/9; border-radius: 8px; object-fit: cover; background: var(--bg-elev-2); }

/* ============================================================
   PLAYER
   ============================================================ */
.player {
  position: fixed; inset: 0; z-index: 150;
  background: #000;
  overflow: hidden;
  display: grid; place-items: center;
}
.player[hidden] { display: none; }
.player video { width: 100%; height: 100%; display: block; background: #000; object-fit: contain; }
.player__scrimTop, .player__scrimBottom {
  position: absolute; left: 0; right: 0; pointer-events: none;
  opacity: 1; transition: opacity .3s;
}
.player__scrimTop { top: 0; height: 120px; background: linear-gradient(180deg, rgba(0,0,0,.7), transparent); }
.player__scrimBottom { bottom: 0; height: 180px; background: linear-gradient(0deg, rgba(0,0,0,.85), transparent); }
.player.is-idle .player__scrimTop, .player.is-idle .player__scrimBottom { opacity: 0; }

.player__top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; align-items: center; gap: 16px;
  padding: 20px clamp(16px, 3vw, 34px);
  opacity: 1; transform: none;
  transition: opacity .3s, transform .3s;
}
.player.is-idle .player__top { opacity: 0; transform: translateY(-12px); }
.player__back, .player__iconbtn {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: #fff; background: transparent;
  transition: background .18s, transform .16s, opacity .18s;
  flex: 0 0 auto; border: 0; cursor: pointer;
}
.player__back:hover, .player__iconbtn:hover { background: rgba(255,255,255,.15); transform: scale(1.1); }
.player__back:active, .player__iconbtn:active { transform: scale(.92); }
.player__titles { flex: 1 1 auto; min-width: 0; }
.player__titles h2 { font-size: clamp(17px, 2.4vw, 25px); text-shadow: 0 2px 12px rgba(0,0,0,.8); }
.player__titles p { margin: 2px 0 0; color: rgba(255,255,255,.72); font-size: 13.5px; text-shadow: 0 2px 10px rgba(0,0,0,.8); }

.player__resume {
  position: absolute; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
}
.player__resume[hidden] { display: none; }
.player__resumeBox {
  background: rgba(15,18,28,.9); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px 28px; text-align: center;
  max-width: 360px;
}
.player__resumeMsg { margin: 0 0 16px; font-size: 16px; font-weight: 600; }
.player__resumeActions { display: flex; gap: 10px; justify-content: center; }
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: rgba(0,0,0,.42); backdrop-filter: blur(2px);
  text-align: center; padding: 20px;
}
.player__center p { color: #ddd; font-size: 14.5px; margin: 0; max-width: 460px; }
.spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.18); border-top-color: #fff;
  animation: spin .85s linear infinite;
}

.player__controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  padding: 0 clamp(16px, 3vw, 34px) clamp(18px, 3vw, 28px);
  opacity: 1; transform: none;
  transition: opacity .28s, transform .28s;
}
.player.is-idle .player__controls { opacity: 0; transform: translateY(16px); }
.player__timeline {
  position: relative; height: 20px; display: flex; align-items: center;
  cursor: pointer; margin-bottom: 6px;
}
.player__buffered, .player__played {
  position: absolute; left: 0; height: 3px; border-radius: 99px; pointer-events: none;
  transition: height .15s;
}
.player__buffered { background: rgba(255,255,255,.3); width: 0; }
.player__played { background: var(--accent); width: 0; }
.player__handle {
  position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 6px rgba(0,0,0,.6);
  transform: translateX(-50%) scale(0); transition: transform .15s;
  pointer-events: none; left: 0; top: -4.5px;
}
.player__timeline:hover .player__handle,
.player__timeline:focus-within .player__handle { transform: translateX(-50%) scale(1); }
.player__timeline:hover .player__buffered,
.player__timeline:hover .player__played,
.player__timeline:focus-within .player__buffered,
.player__timeline:focus-within .player__played { height: 5px; }
.player__seek {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; margin: 0;
}
.player__row { display: flex; align-items: center; gap: 8px; }
.player__row .player__iconbtn:first-child { width: 44px; height: 44px; }
.player__row .player__iconbtn:hover { background: rgba(255,255,255,.16); }
.player__spacer { flex: 1 1 auto; }
.player__time { font-size: 13px; color: rgba(255,255,255,.8); font-variant-numeric: tabular-nums; padding: 0 6px; white-space: nowrap; }
.player__textbtn {
  padding: 8px 13px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 700; color: #fff;
  background: rgba(255,255,255,.12);
  transition: background .18s;
  white-space: nowrap;
}
.player__textbtn:hover { background: rgba(255,255,255,.22); }
.player__textbtn:hover { background: rgba(255,255,255,.24); }
.player__menu { position: relative; }
.player__dropdown {
  position: absolute; bottom: calc(100% + 10px); right: 0;
  min-width: 190px; padding: 6px;
  background: rgba(18,20,28,.97); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  max-height: 300px; overflow-y: auto;
}
.player__dropdown button {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: var(--r-sm);
  font-size: 13.5px; color: var(--text-dim); transition: background .16s, color .16s;
}
.player__dropdown button:hover { background: var(--surface-hover); color: #fff; }
.player__dropdown button.is-on { color: #fff; font-weight: 700; }
.player__dropdown button.is-on::after { content: ' ✓'; color: var(--accent); }

.player__upnext {
  position: absolute; right: clamp(16px, 3vw, 34px); bottom: 130px; z-index: 5;
  width: min(400px, 88vw);
  background: rgba(18,20,28,.97); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
  animation: viewIn .3s var(--ease);
}
.player__upnextLabel { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-faint); font-weight: 800; margin: 0 0 10px; }
.player__upnextItem { display: flex; gap: 12px; margin-bottom: 14px; }
.player__upnextThumb { width: 120px; aspect-ratio: 16/9; border-radius: 8px; object-fit: cover; background: var(--bg-elev-2); flex: 0 0 auto; }
.player__upnextTitle { font-weight: 700; font-size: 15px; }
.player__upnextSub { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.player__upnextActions { display: flex; gap: 10px; justify-content: flex-end; }

.player__help { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; background: rgba(0,0,0,.8); backdrop-filter: blur(8px); }
.player__helpBox { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px 32px; max-width: 440px; }
.player__helpBox h3 { margin-bottom: 16px; font-size: 18px; }
.player__helpBox ul { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.player__helpBox li { font-size: 14px; color: var(--text-dim); }
kbd {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  background: var(--surface-hover); border: 1px solid var(--border-strong);
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: #fff;
}

.player__iconbtn .ico-play, .player__iconbtn .ico-pause { fill: currentColor; stroke: none; }
.player__iconbtn.is-on { color: var(--accent); }

/* ---- player: legendas (renderizadas manualmente) ---- */
.player__subs {
  position: absolute; left: 50%; bottom: 8.5%;
  transform: translateX(-50%);
  z-index: 3; pointer-events: none;
  max-width: min(92%, 1100px);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center;
}
.player__subs[hidden] { display: none; }
.player__subs span {
  display: inline-block;
  padding: .18em .55em;
  border-radius: 6px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: var(--sub-size, 22px);
  font-weight: 600;
  line-height: 1.34;
  text-shadow: 0 2px 6px rgba(0,0,0,.9);
  white-space: pre-wrap;
}
.player__subs[data-bg="none"] span { background: transparent; }
.player__subs[data-bg="solid"] span { background: #000; }
.player__subs[data-size="small"] { --sub-size: 16px; }
.player__subs[data-size="medium"] { --sub-size: 22px; }
.player__subs[data-size="large"] { --sub-size: 30px; }
.player__subs[data-size="xlarge"] { --sub-size: 38px; }

/* ---- player: aviso de +/- segundos ---- */
.player__seekfx {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  opacity: 0; transition: opacity .2s var(--ease);
}
.player__seekfx.is-on { opacity: 1; }
.player__seekfx b {
  display: grid; place-items: center;
  width: 92px; height: 92px; border-radius: 50%;
  background: rgba(0,0,0,.68);
  border: 2px solid rgba(255,255,255,.22);
  backdrop-filter: blur(10px);
  font-size: 34px; font-weight: 800; letter-spacing: -.03em; color: #fff;
  animation: seekPop .28s var(--ease);
}
.player__seekfx span {
  font-size: 14px; font-weight: 700; color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.9);
}
@keyframes seekPop { from { transform: scale(.72); opacity: .4; } }

/* ---- player: preview de tempo na timeline ---- */
.player__preview {
  position: absolute; bottom: 24px;
  transform: translateX(-50%);
  z-index: 6; pointer-events: none;
  padding: 4px 9px; border-radius: 6px;
  background: rgba(0,0,0,.86);
  border: 1px solid rgba(255,255,255,.16);
  font-size: 12.5px; font-weight: 700; color: #fff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.player__preview[hidden] { display: none; }

/* ---- player: volume ---- */
.player__vol { display: flex; align-items: center; gap: 2px; }
.player__volslider {
  width: 0; opacity: 0; margin: 0;
  accent-color: var(--accent);
  height: 20px; cursor: pointer;
  transition: width .2s var(--ease), opacity .2s var(--ease);
}
.player__vol:hover .player__volslider,
.player__vol:focus-within .player__volslider,
.player__vol.is-open .player__volslider { width: 86px; opacity: 1; }

/* ---- player: menus extras ---- */
.player__dropdown--wide { min-width: 260px; max-height: min(70vh, 460px); }
.player__dropdown__label {
  padding: 12px 14px 6px;
  font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .11em;
  color: var(--text-faint);
}
.player__dropdown__sep { height: 1px; background: var(--border); margin: 6px 4px; }
.player__dropdown__row { display: flex; gap: 5px; padding: 2px 8px 8px; flex-wrap: wrap; }
.player__dropdown__row button {
  flex: 1 1 auto; min-width: 62px; text-align: center;
  padding: 7px 6px; font-size: 12.5px;
  background: rgba(255,255,255,.06);
}
.player__dropdown__row button.is-on {
  background: rgba(0,229,255,.18);
  color: var(--accent);
  font-weight: 800;
}
.player__dropdown__row button.is-on::after { content: none; }
.player__dropdown__val {
  flex: 1 1 auto; display: grid; place-items: center;
  padding: 7px 4px; font-size: 12.5px; font-weight: 700;
  color: var(--text-dim); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.player__dropdown__note {
  padding: 0 14px 10px; font-size: 12px; color: var(--text-faint);
  line-height: 1.5;
}

/* ---- player: informacoes tecnicas ---- */
.player__info {
  position: absolute; inset: 0; z-index: 7;
  display: grid; place-items: center;
  background: rgba(0,0,0,.72); backdrop-filter: blur(6px);
  padding: 20px;
}
.player__info[hidden] { display: none; }
.player__infoBox {
  width: min(560px, 94vw); max-height: 84vh; overflow-y: auto;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px 24px;
  box-shadow: var(--shadow-lg);
  animation: viewIn .24s var(--ease);
}
.player__infoHead { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.player__infoHead h3 { margin: 0; font-size: 18px; }
.player__infoBody { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 9px 16px; font-size: 13.5px; }
.player__infoBody dt, .player__infoBody .k { color: var(--text-faint); font-weight: 700; }
.player__infoBody dd, .player__infoBody .v { margin: 0; color: var(--text); word-break: break-word; }

/* ---- player: botao de velocidade ---- */
.player__textbtn--speed { min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }

/* ============================================================
   TOAST / FOOTER
   ============================================================ */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 300; padding: 12px 22px; border-radius: 99px;
  background: rgba(20,23,32,.97); border: 1px solid var(--border);
  box-shadow: var(--shadow); font-size: 14px; font-weight: 600;
  animation: toastIn .28s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px); } }

.footer {
  padding: 22px clamp(14px, 3vw, 40px);
  border-top: 1px solid var(--border);
  color: var(--text-faint); font-size: 13px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.footer > span:first-child { font-weight: 900; letter-spacing: -.03em; color: var(--text-dim); }
.footer__dot { opacity: .4; }
.footer__link { color: var(--cyan); font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 900px) {
  .modal__cols { grid-template-columns: 1fr; }
  .topbar__nav { display: none; }
}

/* ---- player: settings menu (unificado) ---- */
.player__dropdown--settings {
  min-width: 280px; max-width: min(90vw, 360px);
  max-height: 70vh; overflow-y: auto;
  padding: 12px 0;
}
.player__dropdown--settings .player__dropdown__row {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 12px 8px;
}
.player__dropdown--settings .player__dropdown__row button {
  padding: 6px 12px; font-size: 12.5px; border-radius: 4px;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.1);
}
.player__dropdown--settings .player__dropdown__row button.is-on {
  background: rgba(255,255,255,.2); color: #fff; border-color: rgba(255,255,255,.3);
}
.player__dropdown--settings .player__dropdown__row button:hover {
  background: rgba(255,255,255,.15); color: #fff;
}

/* ---- player: settings menu button (full-width) ---- */
.player__dropdown__btn {
  display: block; width: 100%; text-align: left;
  padding: 10px 16px; font-size: 14px; color: rgba(255,255,255,.8);
  transition: background .15s, color .15s; border: 0; background: none; cursor: pointer;
  border-top: 1px solid rgba(255,255,255,.08); margin-top: 4px;
}
.player__dropdown__btn:hover { background: rgba(255,255,255,.1); color: #fff; }@media (max-width: 640px) {
  :root { --rail-w: 138px; --topbar-h: 58px; }
  .search:focus-within { width: 190px; }
  .search:focus-within input { width: 140px; }
  .hero { min-height: 300px; }
  .modal { padding: 0; place-items: end stretch; }
  .modal__panel { border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92vh; width: 100%; }
  .ep__thumb { display: none; }
  .player__row { gap: 4px; flex-wrap: wrap; row-gap: 6px; }
  .player__spacer { flex: 1 1 0; height: 0; margin: 0; }
  .player__time { font-size: 11.5px; padding: 0 2px; }
  .player__iconbtn { width: 40px; height: 40px; }
  .btn { padding: 11px 20px; font-size: 14px; }
  .player__upnext { right: 12px; left: 12px; width: auto; bottom: 120px; }
  .player__textbtn { padding: 7px 9px; font-size: 12.5px; }
  .player__textbtn--speed { min-width: 44px; }
  /* o volume vira um popup flutuante para nao ocupar espaco na linha */
  .player__vol { position: relative; }
  .player__volslider {
    position: absolute; bottom: calc(100% + 8px); right: 0; left: auto;
    width: 90px; height: 26px; opacity: 0; pointer-events: none;
    margin: 0; z-index: 9;
  }
  .player__vol.is-open .player__volslider,
  .player__vol:focus-within .player__volslider {
    width: 90px; opacity: 1; pointer-events: auto;
  }
  .player__subs { bottom: 12%; }
  .player__subs[data-size="small"] { --sub-size: 15px; }
  .player__subs[data-size="medium"] { --sub-size: 19px; }
  .player__subs[data-size="large"] { --sub-size: 24px; }
  .player__subs[data-size="xlarge"] { --sub-size: 30px; }
  /* os menus viram uma folha dentro da tela (nunca saem da viewport) */
  .player__menu { position: static; }
  .player__dropdown {
    position: absolute; left: 12px; right: 12px;
    bottom: calc(100% + 6px);
    min-width: 0; max-width: none; max-height: 56vh;
  }
  .player__dropdown--wide { min-width: 0; }
  .player__infoBody { grid-template-columns: 1fr; gap: 3px 0; }
  .player__infoBody .v { margin-bottom: 8px; }
}

/* ============================================================
   MODO TV (10 feet) - interface grande com foco visivel
   ============================================================ */
body.is-tv {
  --rail-w: 260px;
  --topbar-h: 76px;
  font-size: 17px;
}
body.is-tv .topbar { gap: 40px; }
body.is-tv .topbar__nav a { font-size: 17px; padding: 10px 18px; }
body.is-tv .iconbtn { width: 48px; height: 48px; }
body.is-tv .iconbtn svg { width: 26px; height: 26px; }
body.is-tv .search { height: 48px; }
body.is-tv .search:focus-within { width: 340px; }
body.is-tv .search input { font-size: 17px; }
body.is-tv .card { border-radius: 14px; }
body.is-tv .card:hover, body.is-tv .card:focus-visible { transform: translateY(-8px) scale(1.05); }
body.is-tv .card__title { font-size: 17px; }
body.is-tv .card__phTitle { font-size: 18px; }
body.is-tv .btn { padding: 15px 32px; font-size: 17px; }
body.is-tv .modal__panel { max-width: 1200px; }
body.is-tv .modal__title { font-size: 40px; }
body.is-tv .modal__desc { font-size: 17px; }
body.is-tv .player__iconbtn, body.is-tv .player__back { width: 58px; height: 58px; }
body.is-tv .player__iconbtn svg, body.is-tv .player__back svg { width: 28px; height: 28px; }
body.is-tv .player__textbtn { font-size: 16px; padding: 11px 18px; }
body.is-tv .player__time { font-size: 15px; }
body.is-tv .drawer__links a { font-size: 19px; padding: 15px 18px; }
body.is-tv .ep__title { font-size: 17px; }
body.is-tv .ep__desc { font-size: 15px; }

/* foco por controle remoto */
body.is-tv :focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
body.is-tv .card:focus-visible { outline-offset: 5px; }
body.is-tv .rail__track { scroll-behavior: smooth; }

/* ============================================================
   ACESSIBILIDADE
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}


/* Login screen */
.login-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0a0b10 0%, #1a1b2e 100%);
}
.login-card {
  width: 100%; max-width: 380px; padding: 40px 32px;
  background: rgba(255,255,255,0.05); border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
}
.login-title {
  font-size: 32px; font-weight: 800; text-align: center;
  color: #fff; margin: 0 0 8px;
}
.login-title span { color: #e50914; }
.login-sub { text-align: center; color: #a3a9b8; font-size: 14px; margin: 0 0 24px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form input {
  padding: 12px 16px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08); color: #fff; font-size: 14px; outline: none;
}
.login-form input:focus { border-color: #e50914; }
.login-btn { width: 100%; padding: 12px; font-size: 15px; font-weight: 600; }
.login-error {
  margin-top: 12px; padding: 10px; border-radius: 8px;
  background: rgba(220,38,38,0.15); color: #f87171; font-size: 13px; text-align: center;
}
