/* Tecfag Play — marca Semi Industrial no escuro (tokens de D:\Tecfag_Design\marcas\semi-industrial\tokens.css).
   Um acento só: o vermelho. A imagem do vídeo é o objeto rico da tela; o resto fala baixo. */
@font-face {
  font-family: "Manrope";
  src: url("fontes/Manrope-Variable.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --vermelho: #ED1A3B;
  --vermelho-escuro: #A71B28;
  --preto: #0B0B0C;
  --grafite: #212121;
  --cinza-700: #474747;
  --cinza-500: #979797;
  --cinza-300: #D9D9D9;
  --branco: #FFFFFF;

  --fundo: var(--preto);
  --superficie: #141416;              /* degrau de elevação quase invisível (Raycast, ver DESIGN.md) */
  --fio: rgba(255, 255, 255, 0.08);
  --texto: var(--branco);
  --texto-suave: #B8B8BC;             /* 10:1 sobre o preto */
  --acao: var(--vermelho);
  --acao-hover: var(--vermelho-escuro);

  --fonte: "Manrope", system-ui, sans-serif;
  --t-legenda: 0.75rem;
  --t-pequeno: 0.875rem;
  --t-corpo: 1rem;
  --tracking-titulo: -0.02em;
  --tracking-etiqueta: 0.08em;

  --e-1: 4px; --e-2: 8px; --e-3: 12px; --e-4: 16px; --e-5: 24px; --e-6: 32px; --e-7: 48px;
  --raio-p: 4px;
  --raio-m: 12px;
  --raio-pilula: 999px;
  --dur-rapida: 0.18s;
  --dur: 0.45s;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --seguro-cima: env(safe-area-inset-top, 0px);
  --seguro-baixo: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fundo); color: var(--texto); }
body {
  font-family: var(--fonte);
  font-size: var(--t-corpo);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body.travado { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--branco); outline-offset: 2px; }

/* Ícones Phosphor (pretos no arquivo): ficam brancos aqui */
.icone-btn img, .btn img { filter: invert(1); }
.icone-btn {
  width: 44px; height: 44px;
  display: inline-grid; place-items: center;
  border-radius: var(--raio-pilula);
  position: relative;
}
.icone-btn img { width: 24px; height: 24px; }
.icone-btn:active { background: rgba(255, 255, 255, 0.12); }

/* ---------- Topo ---------- */
.topo {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; gap: var(--e-2);
  padding: calc(var(--e-2) + var(--seguro-cima)) var(--e-2) var(--e-2) var(--e-4);
  background: linear-gradient(180deg, rgba(11, 11, 12, 0.85) 0%, rgba(11, 11, 12, 0) 100%);
  transition: background-color var(--dur) var(--ease);
}
.topo.cheio { background: var(--fundo); border-bottom: 1px solid var(--fio); }
.topo-logo { height: 22px; width: auto; }
.topo-play {
  font-size: var(--t-legenda); font-weight: 800; letter-spacing: 0.16em;
  color: var(--branco); background: var(--vermelho);
  padding: 2px var(--e-2); border-radius: var(--raio-p);
  margin-right: auto;
}

.btn-instalar {
  min-height: 32px; padding: 0 var(--e-3);
  border: 1.5px solid rgba(255, 255, 255, 0.55); border-radius: var(--raio-p);
  font-size: var(--t-legenda); font-weight: 800; letter-spacing: 0.06em;
}
.btn-instalar:active { background: rgba(255, 255, 255, 0.12); }

/* ---------- Destaque ---------- */
.destaque {
  position: relative;
  height: min(82svh, 720px);
  min-height: 460px;
  overflow: hidden;
}
.destaque-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 30%;
}
.destaque::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 11, 12, 0) 40%, rgba(11, 11, 12, 0.75) 72%, var(--fundo) 100%),
    linear-gradient(0deg, rgba(11, 11, 12, 0.35), rgba(11, 11, 12, 0.35));
}
.destaque-texto {
  position: absolute; z-index: 1; left: 0; right: 0; bottom: 0;
  padding: 0 var(--e-4) var(--e-5);
  max-width: 560px;
}
.etiqueta {
  display: inline-block;
  font-size: var(--t-legenda); font-weight: 600;
  text-transform: uppercase; letter-spacing: var(--tracking-etiqueta);
  color: var(--texto-suave);
}
.etiqueta.marca::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: var(--e-2);
  border-radius: var(--raio-pilula); background: var(--vermelho); vertical-align: 1px;
}
.destaque h1 {
  margin: var(--e-2) 0 var(--e-2);
  font-size: clamp(1.9rem, 8.4vw, 3rem); font-weight: 800; line-height: 1.02;
  letter-spacing: var(--tracking-titulo); text-transform: uppercase;
  text-wrap: balance;
}
.meta {
  display: flex; flex-wrap: wrap; gap: var(--e-1) var(--e-3);
  font-size: var(--t-pequeno); color: var(--texto-suave);
  font-variant-numeric: tabular-nums;
}
.destaque-botoes { display: flex; gap: var(--e-3); margin-top: var(--e-4); }

/* ---------- Botões ---------- */
.btn {
  min-height: 48px; padding: 0 var(--e-5);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--e-2);
  border-radius: var(--raio-p);
  font-size: var(--t-pequeno); font-weight: 800; letter-spacing: 0.04em;
  transition: background-color var(--dur-rapida) var(--ease);
}
.btn img { width: 20px; height: 20px; }
.btn-principal { background: var(--acao); color: var(--branco); flex: 1; }
.btn-principal:active { background: var(--acao-hover); }
.btn-secundario { border: 1.5px solid rgba(255, 255, 255, 0.55); color: var(--branco); }
.btn-secundario:active { background: rgba(255, 255, 255, 0.1); }
@media (hover: hover) {
  .btn-principal:hover { background: var(--acao-hover); }
  .btn-secundario:hover { background: rgba(255, 255, 255, 0.1); }
  .icone-btn:hover { background: rgba(255, 255, 255, 0.12); }
}

/* ---------- Fileiras ---------- */
.fileira { margin: var(--e-5) 0 var(--e-2); }
.fileira h2 {
  margin: 0 var(--e-4) var(--e-3);
  font-size: 1.05rem; font-weight: 800; letter-spacing: var(--tracking-titulo);
  text-transform: uppercase;
}
.trilho {
  display: flex; gap: var(--e-2);
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 var(--e-4) var(--e-2);
  scrollbar-width: none;
}
.trilho::-webkit-scrollbar { display: none; }
.cartaz {
  flex: 0 0 auto; width: clamp(118px, 31vw, 172px);
  scroll-snap-align: start;
  position: relative; text-align: left;
}
.cartaz-img {
  position: relative; aspect-ratio: 2 / 3; overflow: hidden;
  border-radius: var(--raio-p); background: var(--superficie);
}
.cartaz-img img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; transition: transform var(--dur) var(--ease); }
@media (hover: hover) { .cartaz:hover .cartaz-img img { transform: scale(1.04); } }
.cartaz-dur {
  position: absolute; right: var(--e-1); bottom: var(--e-2);
  font-size: 0.6875rem; font-weight: 600; font-variant-numeric: tabular-nums;
  background: rgba(11, 11, 12, 0.78); padding: 1px 6px; border-radius: var(--raio-p);
}
.cartaz-progresso { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.25); }
.cartaz-progresso i { display: block; height: 100%; background: var(--vermelho); }
.cartaz-nome {
  margin-top: var(--e-2);
  font-size: var(--t-legenda); font-weight: 600; line-height: 1.3;
  color: var(--texto-suave);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rodape {
  margin: var(--e-7) var(--e-4) calc(var(--e-6) + var(--seguro-baixo));
  font-size: var(--t-legenda); color: var(--cinza-500); text-align: center;
}
.vazio { margin: var(--e-4); color: var(--texto-suave); font-size: var(--t-pequeno); }

/* ---------- Folha de detalhe ---------- */
.folha-fundo { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.6); }
.folha {
  position: fixed; z-index: 31; left: 0; right: 0; bottom: 0;
  max-height: 92svh; overflow-y: auto;
  background: var(--superficie); border-top: 1px solid var(--fio);
  border-radius: var(--raio-m) var(--raio-m) 0 0;
  padding: var(--e-3) var(--e-4) calc(var(--e-5) + var(--seguro-baixo));
  margin: 0 auto; max-width: 640px;
  animation: subir var(--dur) var(--ease);
}
@keyframes subir { from { transform: translateY(100%); } to { transform: none; } }
.folha-alca { width: 40px; height: 4px; border-radius: var(--raio-pilula); background: rgba(255, 255, 255, 0.25); margin: 0 auto var(--e-3); }
.folha-cabeca { display: flex; gap: var(--e-4); align-items: flex-start; }
.folha-cabeca img { width: 104px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--raio-p); flex: 0 0 auto; }
.folha-cabeca .fechar { margin: -6px -10px 0 auto; flex: 0 0 auto; }
.folha h3 {
  margin: var(--e-1) 0 var(--e-2);
  font-size: 1.35rem; font-weight: 800; line-height: 1.05;
  letter-spacing: var(--tracking-titulo); text-transform: uppercase;
}
.folha-desc { margin: var(--e-4) 0; color: var(--texto-suave); font-size: 0.9375rem; max-width: 62ch; }
.folha .btn-principal { width: 100%; }
.folha-lista h4 {
  margin: var(--e-5) 0 var(--e-3);
  font-size: var(--t-legenda); font-weight: 600; text-transform: uppercase; letter-spacing: var(--tracking-etiqueta);
  color: var(--texto-suave);
}

/* ---------- Busca ---------- */
.busca { position: fixed; inset: 0; z-index: 40; background: var(--fundo); overflow-y: auto; }
.busca-barra {
  position: sticky; top: 0; display: flex; align-items: center; gap: var(--e-2);
  padding: calc(var(--e-2) + var(--seguro-cima)) var(--e-4) var(--e-2) var(--e-2);
  background: var(--fundo); border-bottom: 1px solid var(--fio);
}
.busca-barra input {
  flex: 1; height: 44px; padding: 0 var(--e-3);
  font: inherit; font-size: var(--t-corpo); color: var(--texto);
  background: var(--superficie); border: 1px solid var(--fio); border-radius: var(--raio-p);
}
.busca-barra input:focus { outline: none; border-color: var(--branco); }
.busca-grade {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--e-4) var(--e-2);
  padding: var(--e-4);
}
.busca-grade .cartaz { width: auto; }

/* ---------- Player ---------- */
.player { position: fixed; inset: 0; z-index: 50; background: #000; touch-action: manipulation; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-ui {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.75) 100%);
  transition: opacity var(--dur-rapida) linear;
}
.player-ui.escondido { opacity: 0; }                        /* a camada continua recebendo o toque que traz os botões */
.player-ui.escondido * { pointer-events: none; }            /* (botão escondido não aperta sem querer) */
.player-cima { display: flex; align-items: center; gap: var(--e-2); padding: calc(var(--e-2) + var(--seguro-cima)) var(--e-4) 0 var(--e-2); }
.player-titulo { font-size: var(--t-pequeno); font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-meio { display: flex; align-items: center; justify-content: center; gap: var(--e-7); }
.icone-btn.grande { width: 56px; height: 56px; }
.icone-btn.grande img { width: 30px; height: 30px; }
.icone-btn.grande span { position: absolute; font-size: 0.625rem; font-weight: 800; padding-top: 1px; }
.icone-btn.enorme { width: 76px; height: 76px; background: rgba(0, 0, 0, 0.35); }
.icone-btn.enorme img { width: 40px; height: 40px; }
.player-baixo { padding: 0 var(--e-4) calc(var(--e-5) + var(--seguro-baixo)); }
.barra { position: relative; height: 28px; cursor: pointer; touch-action: none; }
.barra::before, .barra-carregado, .barra-feito {
  content: ""; position: absolute; left: 0; top: 12px; height: 4px; border-radius: var(--raio-pilula);
}
.barra::before { right: 0; background: rgba(255, 255, 255, 0.25); }
.barra-carregado { background: rgba(255, 255, 255, 0.45); width: 0; }
.barra-feito { background: var(--vermelho); width: 0; }
.barra-bolinha {
  position: absolute; top: 7px; left: 0; width: 14px; height: 14px; margin-left: -7px;
  border-radius: var(--raio-pilula); background: var(--vermelho);
}
.barra.arrastando .barra-bolinha { transform: scale(1.4); }
.player-tempos { display: flex; justify-content: space-between; font-size: var(--t-legenda); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--texto-suave); }
.player-carregando { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.giro { width: 44px; height: 44px; border-radius: var(--raio-pilula); border: 3px solid rgba(255, 255, 255, 0.2); border-top-color: var(--vermelho); animation: girar 0.9s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.player-erro {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--e-4);
  padding: var(--e-6); text-align: center; background: rgba(0, 0, 0, 0.82);
}
.player-erro img { filter: invert(1); }
.player-erro p { margin: 0; color: var(--texto-suave); }

/* ---------- Aviso curto ---------- */
.aviso {
  position: fixed; z-index: 60; left: 50%; bottom: calc(var(--e-6) + var(--seguro-baixo)); transform: translateX(-50%);
  background: var(--grafite); border: 1px solid var(--fio); color: var(--texto);
  padding: var(--e-2) var(--e-4); border-radius: var(--raio-p); font-size: var(--t-pequeno);
}

/* Tela larga (PC, tablet): o destaque vira faixa com o cartaz ao lado */
@media (min-width: 900px) {
  .destaque { height: 72vh; }
  .destaque-img { object-fit: contain; object-position: right center; }
  .destaque::after {
    background:
      linear-gradient(90deg, var(--fundo) 30%, rgba(11, 11, 12, 0) 70%),
      linear-gradient(180deg, rgba(11, 11, 12, 0) 60%, var(--fundo) 100%);
  }
  .destaque-texto { bottom: 18%; padding-left: var(--e-7); }
  .fileira h2, .rodape { margin-left: var(--e-7); }
  .trilho { padding: 0 var(--e-7) var(--e-2); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
