/* =========================
   THEME
========================= */
:root{
  --bg: #07080A;
  --panel: rgba(14, 16, 20, .78);
  --panel-2: rgba(10, 12, 16, .68);
  --border: rgba(255,255,255,.08);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.65);
  --muted2: rgba(255,255,255,.45);

  --red: #FF2A2A;
  --red2: #FF3B3B;

  --shadow: 0 18px 60px rgba(0,0,0,.65);
  --radius: 18px;
}

/* iOS dá zoom quando foca input com fonte < 16px */
input, textarea, select {
  font-size: 16px !important;
}


* { box-sizing: border-box; }
html, body { height: 100%;  touch-action: manipulation;  /* bloqueia double-tap zoom */ }
body { margin: 0; font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;   -webkit-tap-highlight-color: transparent;
 }

/* =========================
   BACKGROUND
========================= */
.ui-body{
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.bg{ position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg-glow{
  position: absolute;
  filter: blur(50px);
  opacity: .8;
  transform: translate3d(0,0,0);
}
.bg-glow-1{
  width: 560px; height: 560px;
  left: -180px; top: -140px;
  background: radial-gradient(circle at 30% 30%, rgba(255,42,42,.55), rgba(255,42,42,0) 62%);
}
.bg-glow-2{
  width: 720px; height: 720px;
  right: -240px; bottom: -260px;
  background: radial-gradient(circle at 70% 70%, rgba(255,42,42,.35), rgba(255,42,42,0) 60%);
}
.noise{
  position: absolute;
  inset: 0;
  opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}

/* =========================
   AUTH (LOGIN)
========================= */
.auth-wrap{
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.auth-card{
  width: min(460px, 94vw);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel), rgba(10,12,16,.62));
  box-shadow: var(--shadow);
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.auth-card::before{
  content:"";
  position:absolute;
  inset:-2px;
  background: radial-gradient(1200px 280px at 15% 0%, rgba(255,42,42,.20), transparent 55%);
  pointer-events:none;
}

.brand{
  display:flex;
  justify-content:center;
  padding: 8px 0 14px;
}

.brand-logo{
  width: min(340px, 82%);
  height: auto;
  display:block;
  opacity: .98;
  pointer-events:none;
}

.auth-head{ text-align: center; margin-bottom: 14px; }
.title{ margin: 0; font-size: 26px; letter-spacing: .2px; }
.subtitle{ margin: 6px 0 0; color: var(--muted); font-size: 13px; }

.alert{
  display:flex;
  gap: 10px;
  align-items:center;
  margin: 14px 0;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,42,42,.22);
  background: rgba(255,42,42,.08);
  color: rgba(255,255,255,.9);
}
.alert .dot{
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(255,42,42,.12);
}

.form{ display:grid; gap: 10px; }
.label{ font-size: 12px; color: var(--muted); margin-top: 4px; }

.field{
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.35);
  padding: 2px;
}
.input{
  width: 100%;
  border: 0;
  outline: none;
  padding: 12px 12px;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}
.input::placeholder{ color: rgba(255,255,255,.35); }

.field:focus-within{
  border-color: rgba(255,42,42,.35);
  box-shadow: 0 0 0 5px rgba(255,42,42,.10);
}

.btn-primary{
  margin-top: 10px;
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 800;
  letter-spacing: .3px;
  color: #fff;
  background: linear-gradient(90deg, var(--red), var(--red2));
  box-shadow: 0 14px 40px rgba(255,42,42,.18);
  position: relative;
  overflow: hidden;
}
.btn-primary:active{ transform: translateY(1px); }
.btn-primary .btn-shine{
  position:absolute;
  inset:-40px;
  background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,.22), transparent 60%);
  transform: translateX(-40%);
  animation: shine 2.8s ease-in-out infinite;
}
@keyframes shine{
  0%{ transform: translateX(-55%); opacity:.0; }
  35%{ opacity:.65; }
  70%{ transform: translateX(55%); opacity:.0; }
  100%{ opacity:0; }
}

.micro{
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted2);
  line-height: 1.35;
  text-align: center;
}

.auth-foot{
  margin-top: 12px;
  opacity: .8;
}
.chip{
  display:inline-flex;
  gap: 8px;
  align-items:center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.30);
  color: var(--muted);
  font-size: 12px;
}

/* =========================
   TOPBAR
========================= */
.topbar{
  height: 64px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.18);
  backdrop-filter: blur(10px);
}
.topbar-logo{
  height: 28px;
  width: auto;
  display:block;
  opacity:.95;
  pointer-events:none;
}
.topbar-link{
  color: rgba(255,255,255,.82);
  text-decoration:none;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.25);
}
.topbar-link:hover{
  border-color: rgba(255,42,42,.22);
  box-shadow: 0 0 0 5px rgba(255,42,42,.08);
}

/* =========================
   PLAYER PAGE
========================= */
.player-page{
  min-height: calc(100vh - 64px);
  display:grid;
  place-items:center;
  padding: 22px 16px 34px;
}

.player-card{
  width: min(1060px, 96vw);
  display:grid;
  gap: 14px;
}

.player-shell{
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: var(--shadow);
}

.player-shell::before{
  content:"";
  position:absolute;
  inset:-2px;
  background: radial-gradient(900px 220px at 12% 0%, rgba(255,42,42,.18), transparent 55%);
  pointer-events:none;
  z-index: 1;
}

/* O iframe NÃO pode receber clique */
#yt-player, #yt-player iframe{
  width: 100%;
  height: 100%;
  pointer-events: none !important;
  position: relative;
  z-index: 0;
}

/* Controles custom acima de tudo */
.controls{
  position: absolute;
  left: 16px;
  bottom: 16px;
  display:flex;
  gap: 10px;
  z-index: 10;
  pointer-events: auto;
}

.ctl{
  display:flex;
  gap: 8px;
  align-items:center;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.42);
  color: rgba(255,255,255,.92);
  cursor: pointer;
  height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  font-weight: 850;
  letter-spacing: .2px;
  backdrop-filter: blur(8px);
}
.ctl span{ font-size: 12px; color: rgba(255,255,255,.78); font-weight: 750; }
.ctl:hover{
  border-color: rgba(255,42,42,.30);
  box-shadow: 0 0 0 6px rgba(255,42,42,.10);
}
.ctl:active{ transform: translateY(1px); }

.ctl-ghost{
  border-color: rgba(255,42,42,.22);
  background: rgba(255,42,42,.10);
}

/* Badge */
.corner-badge{
  position:absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,42,42,.28);
  background: rgba(0,0,0,.35);
  color: rgba(255,255,255,.90);
  font-weight: 900;
  letter-spacing: 2px;
  font-size: 11px;
}

/* Meta abaixo */
.player-meta{
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.07);
  background: linear-gradient(180deg, rgba(14,16,20,.60), rgba(10,12,16,.52));
  padding: 14px 16px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 14px;
}
.meta-title{ font-weight: 900; }
.meta-sub{ font-size: 12px; color: var(--muted); margin-top: 4px; }
.pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,42,42,.24);
  background: rgba(255,42,42,.10);
  font-weight: 800;
  font-size: 12px;
}

.logout{
  color: rgba(255,255,255,.72);
  text-decoration:none;
  font-weight: 700;
  font-size: 13px;
  opacity: .9;
}

/* Fullscreen: ocupar tudo */
:fullscreen .player-shell{
  width: 100vw !important;
  height: 100vh !important;
  aspect-ratio: auto !important;
  border-radius: 0 !important;
}
:fullscreen #yt-player, :fullscreen iframe{
  width: 100% !important;
  height: 100% !important;
}

/* Responsivo */
@media (max-width: 540px){
  .controls{ left: 12px; bottom: 12px; gap: 8px; }
  .ctl{ height: 42px; padding: 0 12px; }
  .ctl span{ display:none; }
  .topbar{ padding: 0 12px; }
}



/* Máscara que cobre o overlay “Mais vídeos” / endscreen do YouTube */
.endscreen-mask{
  position: absolute;
  inset: 0;
  background: #000;              /* mesma cor do player */
  opacity: 0;                    /* invisível por padrão */
  transition: opacity .18s ease;
  z-index: 6;                    /* abaixo dos botões, acima do iframe */
  pointer-events: none;          /* não atrapalha */
}

/* Quando ativada (pausado/final), ela some com qualquer overlay do iframe */
.endscreen-mask.is-on{
  opacity: 1;
}

.endscreen-mask{ position:absolute; inset:0; opacity:0; transition:opacity .18s ease; z-index:6; pointer-events:none; background:#000; }
.endscreen-mask.is-on{ opacity:1; }
.controls{ z-index:10; }



/* Fake fullscreen (fallback para iOS e casos onde requestFullscreen falha) */
body.fake-fullscreen .topbar,
body.fake-fullscreen .player-meta {
  display: none !important;
}

body.fake-fullscreen .player-page{
  padding: 0 !important;
  min-height: 100dvh !important;
}

body.fake-fullscreen .player-card{
  width: 100vw !important;
  height: 100dvh !important;
  margin: 0 !important;
}

body.fake-fullscreen .player-shell{
  width: 100vw !important;
  height: 100dvh !important;
  aspect-ratio: auto !important;
  border-radius: 0 !important;
}
body.fake-fullscreen #yt-player,
body.fake-fullscreen #yt-player iframe{
  width: 100% !important;
  height: 100% !important;
}

