:root {
  --bg: #070b14;
  --panel: #0e1524;
  --card: #141e30;
  --line: #1e2d48;
  --text: #eef3ff;
  --muted: #8b9bb8;
  --brand: #00b4ff;
  --brand2: #0066ff;
  --accent: #22d3a6;
  --danger: #ff4d6d;
  --radius: 16px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, #0b2244 0%, transparent 50%),
    radial-gradient(900px 500px at 100% 0%, #062a2a 0%, transparent 45%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hide { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; }

.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== NAV (mockup) ===== */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: rgba(7, 11, 20, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand {
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
}
.brand em {
  font-style: normal;
  color: var(--brand);
}

.nav-links {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}
.nav-links .nav-link:hover,
.nav-links .nav-link.active {
  color: var(--text);
  font-weight: 700;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search-wrap input,
.nav-right select {
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0a1220;
  color: var(--text);
  padding: 0 12px;
  font-size: 13px;
}
.search-wrap input { width: min(200px, 28vw); }
.nav-right select { max-width: 150px; }

.user-chip {
  font-size: 12px;
  color: #9fe7ff;
  background: rgba(0, 180, 255, 0.12);
  border: 1px solid rgba(0, 180, 255, 0.3);
  padding: 6px 12px;
  border-radius: 999px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  cursor: pointer;
  flex-shrink: 0;
}

/* ===== BUTTONS ===== */
.btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 18px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}
.btn-sm { padding: 8px 12px; font-size: 12px; }
.btn-block { width: 100%; text-align: center; display: block; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 120, 255, 0.35);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.btn:hover { filter: brightness(1.06); }

/* ===== HERO (mockup slide 1) ===== */
.hero {
  position: relative;
  min-height: 300px;
  background:
    linear-gradient(90deg, rgba(5, 8, 15, 0.95) 0%, rgba(5, 8, 15, 0.4) 55%, transparent 100%),
    linear-gradient(180deg, transparent 40%, #05080f 100%),
    radial-gradient(circle at 70% 40%, #1d4ed8 0%, transparent 45%),
    linear-gradient(135deg, #0b1f3a, #123050 40%, #0a2a28);
  padding: 40px 28px 28px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.hero h1 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin-bottom: 8px;
  max-width: 520px;
  line-height: 1.15;
}
.hero p {
  color: #c6d2e8;
  max-width: 460px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.stats {
  margin-top: 16px;
  color: #9fe7ff;
  font-weight: 600;
  font-size: 13px;
}

/* ===== SECTIONS / CHANNEL GRID ===== */
.section {
  padding: 20px 22px 28px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.section h3 {
  font-size: 15px;
  color: #dbe7ff;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.section h3 small {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
}
.chk {
  color: var(--muted);
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.ch {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  min-height: 110px;
  position: relative;
  cursor: pointer;
  transition: 0.15s transform, 0.15s border-color;
}
.ch:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 180, 255, 0.45);
}
.ch .thumb {
  height: 72px;
  background: linear-gradient(135deg, #1e3a5f, #0f766e);
  display: grid;
  place-items: center;
  position: relative;
}
.ch:nth-child(6n + 2) .thumb { background: linear-gradient(135deg, #7c2d12, #b45309); }
.ch:nth-child(6n + 3) .thumb { background: linear-gradient(135deg, #312e81, #6d28d9); }
.ch:nth-child(6n + 4) .thumb { background: linear-gradient(135deg, #134e4a, #0ea5e9); }
.ch:nth-child(6n + 5) .thumb { background: linear-gradient(135deg, #831843, #db2777); }
.ch:nth-child(6n + 6) .thumb { background: linear-gradient(135deg, #14532d, #22c55e); }
.ch .thumb img {
  max-width: 72%;
  max-height: 72%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}
.ch .thumb .fallback {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 800;
  font-size: 13px;
}
.live-dot {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
  z-index: 1;
}
.ch .meta { padding: 8px 10px 10px; }
.ch .meta strong {
  display: block;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch .meta span {
  color: var(--muted);
  font-size: 11px;
}

/* ===== DEVICES BLOCK (mockup slide 5) ===== */
.devices-section {
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.15);
}
.devices {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  align-items: center;
}
.devices-copy h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}
.devices-copy p {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 16px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: #d7e4ff;
}
.device-art {
  height: 240px;
  border-radius: 20px;
  background:
    linear-gradient(160deg, rgba(0, 180, 255, 0.15), transparent 40%),
    linear-gradient(180deg, #101a2e, #0a1220);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.tv-box {
  width: 78%;
  height: 58%;
  border-radius: 14px;
  background: #020617;
  border: 3px solid #334155;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
  color: var(--brand);
  font-weight: 800;
  letter-spacing: 1px;
}
.phone {
  position: absolute;
  right: 14%;
  bottom: 16%;
  width: 72px;
  height: 130px;
  border-radius: 12px;
  background: #020617;
  border: 3px solid #475569;
  box-shadow: var(--shadow);
}

/* ===== CAROUSEL / RAIL (horizontal channel strip) ===== */
.rail-block {
  padding: 18px 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.rail-head,
.strip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 22px 10px;
  flex-wrap: wrap;
}
.rail-head h3,
.strip-head h3 {
  font-size: 15px;
  color: #dbe7ff;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.rail-head h3 small,
.strip-head h3 small {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
}
.rail-ctrls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rail-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #121a2b;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.rail-btn:hover {
  border-color: var(--brand);
  background: #182338;
}
.rail-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 22px 16px;
  scrollbar-width: thin;
  scrollbar-color: #1e2d48 transparent;
}
.rail-viewport::-webkit-scrollbar { height: 6px; }
.rail-viewport::-webkit-scrollbar-thumb {
  background: #1e2d48;
  border-radius: 999px;
}
.rail-track {
  display: flex;
  gap: 12px;
  width: max-content;
}
.rail-track .ch {
  flex: 0 0 148px;
  width: 148px;
  scroll-snap-align: start;
}
.rail-track .ch.playing {
  border-color: rgba(0, 180, 255, 0.75);
  box-shadow: 0 0 0 1px rgba(0, 180, 255, 0.35), 0 8px 24px rgba(0, 120, 255, 0.2);
}
.rail-track .ch.playing::after {
  content: "▶";
  position: absolute;
  right: 8px;
  top: 8px;
  font-size: 10px;
  background: var(--brand);
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  z-index: 2;
}
.ch { position: relative; }

/* ===== CINEMA PLAYER + floating channel strip ===== */
.cinema {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 70px);
  background: #03060c;
}
.cinema-float {
  /* player ocupa a viewport útil */
  min-height: calc(100vh - 64px);
}
.cinema-stage {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: stretch;
  gap: 0;
  background: #000;
  flex: 1;
  min-height: calc(100vh - 64px);
}
.screen {
  width: 100%;
  min-height: calc(100vh - 64px);
  max-height: none;
  aspect-ratio: auto;
  background: #000;
  position: relative;
  display: grid;
  place-items: center;
  margin: 0 auto;
  overflow: hidden;
}
#video {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 64px);
  background: #000;
  object-fit: contain;
  /* espaço visual para a faixa flutuante não cobrir o centro do vídeo demais */
  padding-bottom: 0;
}
.zap {
  height: 100%;
  min-height: 120px;
  border: 0;
  background: linear-gradient(90deg, #05080f, transparent);
  color: rgba(255, 255, 255, 0.55);
  font-size: 42px;
  cursor: pointer;
  transition: 0.15s color, 0.15s background;
  z-index: 12;
}
.zap-next {
  background: linear-gradient(270deg, #05080f, transparent);
}
.zap:hover {
  color: #fff;
  background: rgba(0, 180, 255, 0.08);
}

/* Camada flutuante SEMPRE sobre o vídeo */
.player-float {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(3, 6, 12, 0.15) 25%,
    rgba(3, 6, 12, 0.72) 55%,
    rgba(3, 6, 12, 0.94) 100%
  );
  padding: 0 0 10px;
}
.player-float .player-bar,
.player-float .channel-strip,
.player-float .rail-btn,
.player-float .btn,
.player-float .ch {
  pointer-events: auto;
}

.player-bar {
  width: 100%;
  padding: 10px 16px 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}
.player-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.p-logo-inline {
  height: 40px;
  max-width: 72px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 4px;
}
.player-bar strong {
  display: block;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
.player-bar span {
  color: #b7c5de;
  font-size: 12px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.player-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Faixa flutuante de canais (sempre visível sobre o vídeo) */
.channel-strip-float {
  padding: 4px 0 8px;
  background: transparent;
  border-top: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.channel-strip-float .strip-head {
  padding: 0 14px 6px;
}
.channel-strip-float .strip-head h3 {
  font-size: 13px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.channel-strip-float .rail-viewport {
  padding: 2px 14px 6px;
}
.channel-strip-float .rail-btn {
  background: rgba(18, 26, 43, 0.85);
  backdrop-filter: blur(6px);
}
.strip-viewport { padding-bottom: 4px; }
.strip-track .ch {
  flex: 0 0 118px;
  width: 118px;
  background: rgba(20, 30, 48, 0.88);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.strip-track .ch .thumb { height: 56px; }
.strip-track .ch .meta { padding: 6px 8px 8px; }
.strip-track .ch .meta strong { font-size: 11px; }
.strip-track .ch.playing {
  border-color: rgba(0, 180, 255, 0.9);
  box-shadow:
    0 0 0 1px rgba(0, 180, 255, 0.5),
    0 10px 28px rgba(0, 120, 255, 0.35);
}

/* ===== FULLSCREEN: vídeo + faixa de canais em tela toda ===== */
.screen:fullscreen,
.screen:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  max-height: none;
  background: #000;
  display: grid;
  place-items: center;
}
.screen:fullscreen #video,
.screen:-webkit-full-screen #video {
  width: 100%;
  height: 100%;
  max-height: 100vh;
  object-fit: contain;
}
.screen:fullscreen .player-float,
.screen:-webkit-full-screen .player-float {
  /* mantém carrossel flutuando também em fullscreen */
  z-index: 20;
}
.screen:fullscreen .channel-strip-float .ch,
.screen:-webkit-full-screen .channel-strip-float .ch {
  flex: 0 0 128px;
  width: 128px;
}
#btnFullscreen {
  white-space: nowrap;
}

/* ===== APPS PAGE ===== */
.apps-hero {
  padding: 36px 28px 24px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(0, 102, 255, 0.12), transparent 50%),
    linear-gradient(180deg, #0c1424, transparent);
}
.apps-hero h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 6px 0 10px;
}
.apps-hero p {
  color: #c6d2e8;
  max-width: 640px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.apps-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  max-width: 720px;
}
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.app-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
}
.app-card.primary {
  border-color: rgba(0, 180, 255, 0.55);
  background: linear-gradient(180deg, #10233f, #0f1728);
  box-shadow: 0 12px 32px rgba(0, 120, 255, 0.15);
}
.app-card .platform {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.app-card h4 {
  font-size: 1.05rem;
  line-height: 1.25;
}
.app-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  flex: 1;
}
.app-card .app-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.app-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(34, 211, 166, 0.12);
  color: var(--accent);
  border: 1px solid rgba(34, 211, 166, 0.3);
  width: fit-content;
}
.app-badge.warn {
  background: rgba(255, 77, 109, 0.1);
  color: #ff8fa3;
  border-color: rgba(255, 77, 109, 0.3);
}

/* ===== LOGIN MODAL (mockup slide 2) ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.login-bg {
  min-height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(600px 300px at 20% 20%, rgba(0, 140, 255, 0.18), transparent),
    radial-gradient(500px 280px at 90% 80%, rgba(34, 211, 166, 0.12), transparent),
    rgba(5, 8, 15, 0.92);
  padding: 28px;
}
.login-card {
  width: min(400px, 100%);
  background: rgba(14, 21, 36, 0.96);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.logo-center {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}
.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(0, 140, 255, 0.35);
  font-size: 16px;
  color: #fff;
}
.login-card h2 {
  font-size: 1.35rem;
  margin: 8px 0 6px;
  text-align: center;
}
.login-card > p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.45;
  text-align: center;
}
.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field .input,
.login-card input.input {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0a1220;
  color: var(--text);
  padding: 0 12px;
  font-size: 14px;
}
.err {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin: 4px 0 8px;
  text-align: center;
}
.hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ===== FOOTER ===== */
.footer {
  margin-top: auto;
  padding: 18px 22px 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.logo-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 14px;
}
.logo-mini .logo-mark {
  width: 32px;
  height: 32px;
  font-size: 12px;
}
.logo-mini em {
  font-style: normal;
  color: var(--brand);
}
.footer-muted {
  color: var(--muted);
  font-size: 12px;
}

.muted { color: var(--muted); }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .devices { grid-template-columns: 1fr; }
  .search-wrap input { width: 120px; }
  .hero { min-height: 260px; padding: 28px 18px 22px; }
  .section { padding: 16px; }
  .cinema-stage {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 56px);
  }
  .screen,
  #video {
    min-height: calc(100vh - 56px);
    max-height: none;
  }
  .zap { display: none; }
  .rail-track .ch {
    flex: 0 0 128px;
    width: 128px;
  }
  .strip-track .ch {
    flex: 0 0 104px;
    width: 104px;
  }
  .player-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .player-actions { justify-content: flex-start; }
  .channel-strip-float .rail-viewport { padding: 2px 10px 4px; }
}
