:root {
  --accent: #2392ee;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f4f5f8;
  --muted: #9aa0b4;
  --bar-h: 80px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #000; overflow: hidden; }
body { color: var(--text); font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
a { color: inherit; text-decoration: none; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 6px; }

/* ---------- player em tela cheia ---------- */
.stage { position: fixed; top: var(--bar-h); right: 0; bottom: 0; left: 0; background: #000; }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 2; background: transparent; }
.loader { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; }
.loader i { width: 46px; height: 46px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.1); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.msg { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); line-height: 1.8; background: #000; }
.msg code { color: var(--text); background: rgba(255, 255, 255, 0.07); padding: 3px 9px; border-radius: 7px; font-size: 13px; }

/* ---------- barra superior (sempre visível) ---------- */
.bar {
  position: fixed; z-index: 30; top: 0; left: 0; right: 0; height: var(--bar-h);
  padding: 0 24px; padding-top: env(safe-area-inset-top);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: linear-gradient(to bottom, #0d0d13, #08080c); border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.bar-left, .bar-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.bar-left { gap: 20px; }
.bar-right { justify-content: flex-end; }

.close {
  width: 40px; height: 40px; display: grid; place-items: center; flex: none; border-radius: 50%;
  opacity: 0.8; transition: transform 0.45s var(--ease), opacity 0.3s;
}
.close svg { width: 26px; height: 26px; stroke-width: 1.8; }
.close:hover { opacity: 1; transform: rotate(90deg) scale(1.08); }
.close:active { transform: rotate(90deg) scale(0.92); }
.close.sm { width: 34px; height: 34px; }
.close.sm svg { width: 20px; height: 20px; }

.logo { display: inline-flex; align-items: center; transition: transform 0.45s var(--ease); }
.logo:hover { transform: scale(1.05); }
.logo img { height: 48px; width: auto; }

.eps-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 600;
  opacity: 0.85; transition: opacity 0.3s, background 0.3s;
}
.eps-btn svg { width: 20px; height: 20px; }
.eps-btn:hover, .eps-btn.on { opacity: 1; background: rgba(255, 255, 255, 0.08); }

/* ---------- servidores (dropdown) ---------- */
.servers { position: relative; }
.srv-trigger {
  display: flex; align-items: center; gap: 12px; padding: 7px 14px 7px 8px; min-width: 210px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.4s;
}
.srv-trigger:hover { background: rgba(255, 255, 255, 0.09); }
.servers.open .srv-trigger { background: rgba(255, 255, 255, 0.1); border-color: rgba(35, 146, 238, 0.55); box-shadow: 0 0 0 4px rgba(35, 146, 238, 0.14); }
.srv-icon {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #3aa5ff, #1b6fd1); box-shadow: 0 4px 16px rgba(35, 146, 238, 0.4);
}
.srv-icon svg { width: 18px; height: 18px; }
.srv-text { flex: 1; min-width: 0; line-height: 1.2; }
.srv-text small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.srv-text b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { width: 18px; height: 18px; flex: none; color: var(--muted); transition: transform 0.5s var(--ease); }
.servers.open .chev { transform: rotate(180deg); color: #fff; }

.srv-menu {
  position: absolute; z-index: 50; top: calc(100% + 12px); right: 0; width: 320px; max-width: calc(100vw - 24px); padding: 8px;
  background: rgba(16, 16, 22, 0.92); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 18px;
  backdrop-filter: blur(28px) saturate(160%); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 0, 0, 0.4);
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-10px) scale(0.96); transform-origin: top right;
  transition: opacity 0.3s ease, transform 0.5s var(--ease), visibility 0s 0.5s;
  max-height: calc(100vh - var(--bar-h) - 24px); overflow-y: auto;
}
.servers.open .srv-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition-delay: 0s; }
.opt {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 12px;
  opacity: 0; transform: translateY(-6px); transition: background 0.25s, opacity 0.4s ease, transform 0.5s var(--ease);
}
.servers.open .opt { opacity: 1; transform: none; transition-delay: calc(var(--i) * 28ms + 60ms), calc(var(--i) * 28ms + 60ms), calc(var(--i) * 28ms + 60ms); }
.opt:hover, .opt.focus { background: rgba(255, 255, 255, 0.07); }
.opt .idx {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none;
  font-size: 12.5px; font-weight: 700; color: var(--muted); background: rgba(255, 255, 255, 0.06); transition: all 0.3s;
}
.opt .nm { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.25; }
.opt .nm small { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.opt .nm small i { width: 5px; height: 5px; border-radius: 50%; background: #ffbe3c; }
.opt.locked .nm { color: rgba(255, 255, 255, 0.72); }
.opt.vip .idx, .opt.locked .idx { background: rgba(255, 190, 60, 0.12); color: #ffbe3c; }
.vip-badge {
  flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; color: #1a1100;
  background: linear-gradient(135deg, #ffd36b, #ff9f0a); box-shadow: 0 4px 14px rgba(255, 159, 10, 0.35);
}
.vip-badge svg { width: 12px; height: 12px; }
.vip-toast {
  position: fixed; z-index: 100; left: 50%; bottom: 28px; display: flex; align-items: center; gap: 14px;
  padding: 12px 14px 12px 18px; border-radius: 14px; font-size: 14px; color: #fff;
  background: rgba(20, 20, 24, 0.92); border: 1px solid rgba(255, 159, 10, 0.4);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5); transform: translate(-50%, 20px); opacity: 0; transition: all 0.4s var(--ease);
}
.vip-toast.show { transform: translate(-50%, 0); opacity: 1; }
.vip-toast b { color: #ffbe3c; }
.vip-toast a {
  padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 800; color: #1a1100; text-decoration: none;
  background: linear-gradient(135deg, #ffd36b, #ff9f0a);
}
.opt .tick { width: 18px; height: 18px; flex: none; opacity: 0; transform: scale(0.5); transition: all 0.4s var(--ease); color: #fff; stroke-width: 3; }
.opt.active { background: rgba(35, 146, 238, 0.14); }
.opt.active .idx { background: linear-gradient(135deg, #3aa5ff, #1b6fd1); color: #fff; box-shadow: 0 4px 14px rgba(35, 146, 238, 0.4); }
.opt.active .tick { opacity: 1; transform: none; color: #5bb4ff; }

/* ---------- gaveta de episódios ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.5); opacity: 0; pointer-events: none; transition: opacity 0.5s ease; }
.drawer {
  position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(420px, 100vw);
  display: flex; flex-direction: column; overflow: hidden;
  background: rgba(10, 10, 14, 0.9); border-left: 1px solid var(--line); backdrop-filter: blur(30px) saturate(150%);
  transform: translateX(100%); transition: transform 0.7s var(--ease);
}
body.drawer-open .drawer { transform: none; }
body.drawer-open .scrim { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; align-items: center; gap: 14px; padding: 22px 22px 18px; }
.drawer-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; flex: 1; }
.select {
  appearance: none; cursor: pointer; outline: 0; max-width: 170px;
  background: rgba(255, 255, 255, 0.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23c7cad6' stroke-width='2'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: var(--text); border: 1px solid transparent; border-radius: 10px; padding: 10px 36px 10px 14px; font: inherit; font-size: 13.5px; font-weight: 500;
  transition: background-color 0.3s, border-color 0.3s;
}
.select:hover { background-color: rgba(255, 255, 255, 0.1); }
.select:focus { border-color: rgba(255, 255, 255, 0.35); }
.select option { background: #14141c; }
.drawer-list { scrollbar-width: auto; scrollbar-color: #2392ee rgba(255,255,255,0.08); flex: 1; min-height: 0; overflow-y: auto; padding: 4px 14px 28px; display: flex; flex-direction: column; gap: 6px; }
.ep { flex: none; display: flex; align-items: center; gap: 14px; width: 100%; padding: 8px; border-radius: 14px; border: 1px solid transparent; transition: background 0.3s, border-color 0.3s; }
.ep:hover { background: rgba(255, 255, 255, 0.06); }
.ep .thumb { position: relative; flex: none; width: 136px; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: #181820; }
.ep .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.ep:hover .thumb img { transform: scale(1.07); }
.ep .thumb .no-img { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 700; color: rgba(255, 255, 255, 0.25); }
.ep .thumb .seen { position: absolute; right: 6px; top: 6px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.92); color: #0a0a0f; }
.ep .thumb .seen svg { width: 11px; height: 11px; stroke-width: 3.2; }
.ep .info { min-width: 0; flex: 1; line-height: 1.3; }
.ep .info small { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.ep .info b { display: block; margin-top: 2px; font-size: 14px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep .info span { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.ep.current { background: rgba(35, 146, 238, 0.12); border-color: rgba(35, 146, 238, 0.45); }
.drawer-empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- responsivo ---------- */
@media (max-width: 760px) {
  :root { --bar-h: 74px; }
  .bar { gap: 8px; padding: 0 10px; padding-top: env(safe-area-inset-top); }
  .bar-left { gap: 8px; }
  .logo img { height: 36px; }
  .eps-btn { padding: 8px 10px; gap: 6px; }
  .eps-btn span { font-size: 13px; }
  .bar-left { flex: none; }
  .bar-right { gap: 6px; flex: 1; }
  .servers { min-width: 0; flex: 0 1 auto; }
  .srv-trigger { min-width: 0; max-width: 100%; }
  .servers { max-width: calc(100vw - 232px); }
  .servers { position: static; }
  .srv-menu { right: 10px; top: calc(100% + 6px); }
  .drawer-list { padding: 4px 12px 24px; }
  .ep .thumb { width: 118px; }
}
@media (max-width: 480px) {
  .bar { gap: 6px; padding: 0 8px; }
  .bar-left { gap: 4px; }
  .close { width: 36px; height: 36px; }
  .close svg { width: 24px; height: 24px; }
  .logo img { height: 34px; }
  .srv-trigger { gap: 8px; padding: 6px 10px 6px 6px; }
  .srv-icon { display: none; }
  .srv-trigger { padding: 8px 10px 8px 12px; }
  .srv-text small { font-size: 9px; letter-spacing: 0.08em; }
  .srv-text b { font-size: 13px; }
  .eps-btn { padding: 8px; }
  .eps-btn span { font-size: 12px; }
}

/* ---------- cortinas de cinema (abertura) ---------- */
.curtains { position: fixed; inset: 0; z-index: 100; overflow: hidden; pointer-events: auto; }
.curtains.done { display: none; }
.cur-glow {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(ellipse 55% 70% at 50% 55%, rgba(120, 190, 255, 0.55), rgba(35, 146, 238, 0.18) 45%, transparent 75%);
  transition: opacity 1.4s ease 0.2s;
}
.cur {
  position: absolute; top: 0; bottom: 0; width: 50.4%;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 22%, transparent 72%, rgba(0, 0, 0, 0.6)),
    repeating-linear-gradient(90deg, #470510 0, #8c1121 30px, #cc2139 50px, #8c1121 70px, #470510 100px);
  transition: transform 2.6s cubic-bezier(0.65, 0, 0.2, 1) 0.15s;
  will-change: transform;
}
.cur::after { content: ''; position: absolute; top: 0; bottom: 0; width: 7px;
  background: linear-gradient(90deg, #8a6420, #f7da8b 45%, #b88a2f); box-shadow: 0 0 22px rgba(255, 210, 120, 0.45); }
.cur-l { left: 0; transform-origin: left center; }
.cur-l::after { right: 0; }
.cur-r { right: 0; transform-origin: right center; }
.cur-r::after { left: 0; }
.pelmet {
  position: absolute; top: 0; left: 0; right: 0; height: clamp(46px, 8vh, 78px); z-index: 3;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 60%),
    repeating-linear-gradient(90deg, #3a040d 0, #7a0e1c 22px, #b81c32 38px, #7a0e1c 54px, #3a040d 76px);
  border-bottom: 5px solid #d9b25c; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 5px 0 rgba(120, 80, 10, 0.6);
  transition: transform 1s var(--ease) 2.2s;
}
.cur-logo {
  position: absolute; z-index: 4; left: 50%; top: 50%; height: clamp(54px, 10vw, 96px); width: auto;
  transform: translate(-50%, -50%); filter: drop-shadow(0 0 24px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 40px rgba(35, 146, 238, 0.5));
  animation: logo-in 0.9s var(--ease) both; transition: opacity 0.7s ease, transform 1s var(--ease);
}
@keyframes logo-in { from { opacity: 0; transform: translate(-50%, -46%) scale(0.92); } }
.curtains.open .cur-glow { opacity: 1; }
.curtains.open .cur-l { transform: scaleX(0.07); }
.curtains.open .cur-r { transform: scaleX(0.07); }
.curtains.open .pelmet { transform: translateY(-120%); }
.curtains.open .cur-logo { opacity: 0; transform: translate(-50%, -50%) scale(1.25); animation: none; }
.curtains.fade { opacity: 0; transition: opacity 0.5s ease; }
@media (prefers-reduced-motion: reduce) { .curtains { display: none; } }

/* ---------- anterior / próximo episódio ---------- */
.epnav {
  position: fixed; z-index: 20; top: calc(50% + var(--bar-h) / 2); transform: translateY(-50%);
  display: flex; align-items: center; gap: 12px; max-width: min(300px, 34vw); padding: 7px;
  border-radius: 16px; background: rgba(12, 12, 18, 0.62); border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px) saturate(160%); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  opacity: 0.92; transition: transform 0.5s var(--ease), opacity 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.4s;
  animation: nav-in 0.8s var(--ease) both;
}
.epnav.prev { left: 14px; padding-right: 16px; }
.epnav.next { right: 14px; padding-left: 16px; text-align: right; }
.epnav:hover { opacity: 1; background: rgba(18, 22, 32, 0.8); border-color: rgba(35, 146, 238, 0.55); box-shadow: 0 16px 44px rgba(0, 0, 0, 0.6), 0 0 0 4px rgba(35, 146, 238, 0.12); }
.epnav.prev:hover { transform: translateY(-50%) translateX(-3px); }
.epnav.next:hover { transform: translateY(-50%) translateX(3px); }
.epnav:active { transform: translateY(-50%) scale(0.97); }
.epnav .th { position: relative; flex: none; width: 104px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #181820; }
.epnav .th img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.epnav:hover .th img { transform: scale(1.08); }
.epnav .th i { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 22px; font-weight: 700; color: rgba(255, 255, 255, 0.3); }
.epnav .tx { min-width: 0; line-height: 1.3; }
.epnav .tx small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.epnav .tx b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; font-size: 14px; font-weight: 600; }
.epnav .ar { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); transition: background 0.3s; }
.epnav:hover .ar { background: var(--accent); }
.epnav .ar svg { width: 15px; height: 15px; stroke-width: 2.4; }
@keyframes nav-in { from { opacity: 0; } }
body.drawer-open .epnav { opacity: 0; pointer-events: none; }
@media (max-width: 760px) {
  .epnav { top: auto; bottom: calc(96px + env(safe-area-inset-bottom)); transform: none; width: calc(50% - 18px); max-width: 190px; gap: 8px; padding: 5px; border-radius: 12px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5); opacity: 0.88; }
  .epnav.prev { left: 10px; padding-right: 10px; }
  .epnav.next { right: 10px; padding-left: 10px; }
  .epnav.prev:hover, .epnav.next:hover, .epnav:active { transform: none; }
  .epnav .th { width: 46px; border-radius: 7px; }
  .epnav .th i { font-size: 16px; }
  .epnav .ar { display: none; }
  .epnav .tx { flex: 1; }
  .epnav .tx small { font-size: 8.5px; letter-spacing: 0.05em; overflow: hidden; text-overflow: ellipsis; }
  .epnav .tx b { font-size: 11.5px; -webkit-line-clamp: 1; }
}
@media (max-width: 760px) and (max-height: 480px) {
  .epnav { bottom: 74px; width: auto; max-width: 30vw; }
  .epnav .th { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media (max-width: 380px) {
  .srv-trigger { gap: 4px; padding: 8px 8px 8px 10px; }
  .eps-btn svg { width: 18px; height: 18px; }
  .logo img { height: 30px; }
}

.drawer-list::-webkit-scrollbar { width: 14px; }
.drawer-list::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.06); border-radius: 10px; margin: 6px 0; }
.drawer-list::-webkit-scrollbar-thumb { background: #2392ee; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; min-height: 48px; }
.drawer-list::-webkit-scrollbar-thumb:hover { background: #4aa8ff; background-clip: padding-box; }
@media (max-width: 760px) { .drawer-list::-webkit-scrollbar { width: 10px; } }
