/* GIPTV - estilo tipo RingoQuiz (móvil-first) */
:root{
  --bg0:#070816;
  --bg1:#0b0f2a;
  --glass: rgba(255,255,255,.06);
  --stroke: rgba(255,255,255,.10);
  --text:#f3f4ff;
  --muted: rgba(243,244,255,.70);
  --accent:#7a6bff;
  --danger:#ff3b30;
  --radius:28px;
  --shadow: 0 18px 60px rgba(0,0,0,.45);
}

*{box-sizing:border-box}
html,body{height:100%; overflow-x:hidden}
body{
  margin:0;
  max-width:100vw;
  overflow-x:hidden;
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background:
    radial-gradient(1100px 700px at 20% 20%, rgba(122,107,255,.18), transparent 55%),
    radial-gradient(900px 600px at 80% 70%, rgba(90,215,255,.14), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  -webkit-font-smoothing: antialiased;
}

a{color:inherit; text-decoration:none}

.rq-shell{min-height:100%; padding:16px  padding-bottom: 220px;
}
.rq-shell::before{
  content:"";
  position:fixed;
  inset:16px;
  border-radius: 36px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
  pointer-events:none;
}

.topbar{
  transition: transform 180ms ease, opacity 180ms ease;

  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px;
  border-radius: 26px;
  background: rgba(10,12,24,.45);
  border:1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand{display:flex; gap:12px; align-items:center}
.logo{
  width:48px; height:48px;
  display:grid; place-items:center;
  border-radius:18px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  font-size:22px;
}
.title h1{margin:0; font-size:18px; letter-spacing:.2px}
.subtitle{margin-top:3px; font-size:12px; color:var(--muted)}
.top-actions{display:flex; gap:10px; align-items:center}

.layout{
  display:grid;
  grid-template-columns: 1.15fr .95fr 1.25fr;
  gap:14px;
  padding:14px 2px 0;
  align-items:start;
}
@media (max-width: 1100px){ .layout{grid-template-columns:1fr} }

.card{
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: 0 14px 40px rgba(0,0,0,.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding:14px;
}

.player video{
  width:100%;
  max-height: 32vh;
  margin-top:12px;
  border-radius: 22px;
  background:#000;
  object-fit:contain;
  aspect-ratio: 16/9;
  border:1px solid rgba(255,255,255,.10);
}

.pill{
  display:inline-flex; align-items:center; gap:8px;
  font-size:12px;
  padding:8px 12px;
  border-radius:999px;
  background: rgba(122,107,255,.10);
  border:1px solid rgba(122,107,255,.25);
}
.now-title{margin-top:10px; font-weight:750; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.now-url{margin-top:6px; font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}

.player-foot{
  display:flex; gap:12px; align-items:center; justify-content:space-between;
  margin-top:12px;
  flex-wrap:wrap;
}
.chk{display:flex; gap:8px; align-items:center; font-size:13px; color:var(--muted)}
.chk input{width:auto}
.hint{font-size:12px; color:var(--muted)}

.stack{display:flex; flex-direction:column; gap:12px}
.box{
  padding:14px;
  border-radius: 22px;
  background: rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
}
.box h3{margin:0 0 10px; font-size:14px; color:rgba(243,244,255,.92)}

.row{display:flex; gap:10px; align-items:center}
.row.wrap{flex-wrap:wrap}
.row.grow{width:100%}
.row.grow input{flex:1}

input, textarea, select{
  width:100%;
  border-radius: 18px;
  border:1px solid rgba(255,255,255,.10);
  padding:12px 12px;
  background: rgba(0,0,0,.14);
  color:var(--text);
  outline:none;
}
select{cursor:pointer}
input::placeholder, textarea::placeholder{color:rgba(243,244,255,.45)}
textarea{resize:vertical}

.panel{margin-top:10px}
.small{margin-top:8px; font-size:12px; color:var(--muted)}

.btn{
  appearance:none;
  border:1px solid rgba(255,255,255,.10);
  background: linear-gradient(90deg, rgba(122,107,255,.92), rgba(122,107,255,.78));
  color:#ffffff;
  font-weight:800;
  padding:12px 14px;
  border-radius: 999px;
  cursor:pointer;
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
}
.btn:active{transform: translateY(1px)}
.btn.ghost{
  background: rgba(255,255,255,.06);
  color: var(--text);
  box-shadow:none;
}

.list-head{display:flex; gap:12px; justify-content:space-between; align-items:center}
.list-head h2{margin:0}
.tabs{display:flex; gap:8px}
.tab{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color:var(--text);
  padding:10px 14px;
  border-radius: 999px;
  cursor:pointer;
}
.tab.active{
  background: rgba(122,107,255,.18);
  border-color: rgba(122,107,255,.30);
}

.channels{display:flex; flex-direction:column; gap:10px; margin-top:12px}
.channel{
  display:flex; gap:10px; align-items:center; justify-content:space-between;
  padding:14px;
  border-radius: 22px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.12);
}
.channel .meta{min-width:0}
.channel .name{font-weight:800; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.channel .sub{font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.channel .actions{display:flex; gap:10px; align-items:center}

.star, .play{
  width:46px; height:46px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color:var(--text);
  cursor:pointer;
}
.star.on{
  background: rgba(122,107,255,.22);
  border-color: rgba(122,107,255,.35);
}

.empty{
  margin-top:14px;
  padding:16px;
  border-radius: 22px;
  border:1px dashed rgba(255,255,255,.16);
  color:var(--muted);
  background: rgba(255,255,255,.03);
}

.footer{
  padding:14px 4px 8px;
  display:flex;
  gap:10px;
  justify-content:center;
  align-items:center;
  color:var(--muted);
}
.dot{opacity:.5}
.link{color:rgba(122,107,255,.95)}

/* Modal bienvenida */
.rq-overlay{
  position:fixed;
  inset:0;
  display:grid;
  place-items:center;
  background: rgba(0,0,0,.55);
  z-index:9999;
  padding:18px;
}
.rq-overlay[hidden]{display:none !important}

.rq-modal{
  width:min(980px, 96vw);
  height:min(560px, 86vh);
  border-radius: 36px;
  border:1px solid rgba(255,255,255,.12);
  background:
    linear-gradient(90deg, rgba(122,107,255,.18) 0%, rgba(122,107,255,.10) 34%, rgba(0,0,0,.18) 34%, rgba(0,0,0,.18) 100%),
    rgba(10,12,24,.70);
  box-shadow: 0 30px 90px rgba(0,0,0,.60);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display:grid;
  grid-template-columns: 34% 66%;
  overflow:hidden;
  position:relative;
}
@media (max-width: 760px){
  .rq-modal{grid-template-columns: 1fr; height:auto}
  .rq-left{min-height:160px}
}

.rq-close{
  position:absolute; right:14px; top:14px;
  width:44px; height:44px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(243,244,255,.85);
  font-size:28px;
  line-height:40px;
  cursor:pointer;
}
.rq-left{display:flex; align-items:center; justify-content:center; position:relative; padding:18px}
.rq-appicon{
  width:86px; height:86px;
  border-radius: 22px;
  background: rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.14);
  display:grid;
  place-items:center;
  font-size:34px;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}
.rq-deco{position:absolute; right:22px; bottom:18px; font-size:18px; opacity:.35}
.rq-mascot{position:absolute; left:24px; bottom:14px; font-size:18px; opacity:.55}
.rq-right{padding:34px 32px 28px}
.rq-right h2{margin:0 0 14px; font-size:28px}
.rq-text{margin:0 0 18px; color: rgba(243,244,255,.75); font-size:16px; line-height:1.55}
.rq-tip{
  display:flex; gap:10px; align-items:center;
  margin:18px 0 22px; padding:14px 16px;
  border-radius: 18px;
  border:1px solid rgba(122,107,255,.25);
  background: rgba(122,107,255,.12);
  color: rgba(243,244,255,.80);
}
.rq-main{
  width:min(460px, 100%);
  padding:16px 18px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.10);
  background: linear-gradient(90deg, rgba(122,107,255,.95), rgba(122,107,255,.70));
  color:white;
  font-weight:900;
  font-size:18px;
  cursor:pointer;
  box-shadow: 0 14px 30px rgba(0,0,0,.28);
}
.rq-sep{margin:22px 0 16px; height:1px; background: rgba(255,255,255,.10)}
.rq-ded{
  margin-top:18px;
  padding:12px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
  color: rgba(122,107,255,.95);
  font-weight:900;
  text-align:center;
}


/* Contención para iPad/desktop: evita UI 'gigante' y scroll horizontal */
.container{
  width:100%;
  max-width: 980px;
  margin: 0 auto;
}

.topbar, .layout, .channels{max-width:980px; margin-left:auto; margin-right:auto;}



/* Player sticky bajo la topbar (sin parpadeos) */
.player{
  position: sticky;
  top: 86px; /* debajo de la topbar */
  z-index: 19; /* por debajo de la topbar (20) */
}
@media (max-width: 1100px){
  .player{ top: 78px; }
}


/* Auto-ocultar barras al hacer scroll */
body.ui-compact .topbar{
  transform: translateY(-120%);
  opacity: 0;
  pointer-events: none;
}

body.ui-compact .player{
  top: 16px;
}

.player{
  transition: top 180ms ease;
}

/* Oculta la barra inferior del reproductor en modo compacto */
body.ui-compact .player-foot{
  display: none !important;
}

/* === Player compact UI cleanup === */
.now,
.player-foot {
  display: none !important;
}

/* iOS: backdrop-filter can hide native video controls inside sticky/fixed elements */
.player {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* OK.RU iframe mode */
.player-iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 22px;
  background: #000;
}

.player.is-iframe #videoPlayer {
  display: none !important;
}

.player.is-iframe .player-iframe {
  display: block !important;
}
