/* CINE - interfaz para pantalla tactil del carro.
   Reglas: todo grande, todo con mucho contraste, nada que dependa de pasar el mouse por encima. */

:root {
  --fondo: #0a0a0c;
  --fondo-2: #141419;
  --fondo-3: #1e1e26;
  --texto: #f2f2f5;
  --texto-2: #9a9aa8;
  --acento: #e11d2e;
  --borde: #2a2a34;
  --toque: 72px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--fondo); color: var(--texto);
  font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  overscroll-behavior: none;
}
body { -webkit-user-select: none; user-select: none; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
.oculto { display: none !important; }

.pantalla { min-height: 100%; }

/* ---------- PIN ---------- */
#pantallaPin {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}
.pin-caja { width: 100%; max-width: 420px; text-align: center; }
.marca {
  font-size: 40px; font-weight: 800; letter-spacing: 8px;
  margin: 0 0 8px; color: var(--acento);
}
.pin-ayuda { color: var(--texto-2); font-size: 20px; margin: 0 0 24px; }
.pin-puntos { display: flex; justify-content: center; gap: 18px; height: 22px; margin-bottom: 12px; }
.punto { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--texto-2); }
.punto.lleno { background: var(--acento); border-color: var(--acento); }
.pin-error { color: var(--acento); font-size: 18px; height: 26px; margin-bottom: 12px; }

.teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tecla {
  height: 84px; font-size: 32px; font-weight: 600;
  background: var(--fondo-2); border: 1px solid var(--borde); border-radius: 16px;
  color: var(--texto);
}
.tecla:active { background: var(--fondo-3); }
.tecla-vacia { background: none; border: none; }

/* ---------- BIBLIOTECA ---------- */
.barra {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 20px 28px 12px;
  position: sticky; top: 0; z-index: 5; background: var(--fondo);
}
.barra .marca { font-size: 28px; margin: 0; }
.barra-acciones { display: flex; align-items: center; gap: 12px; }
.buscador {
  height: 56px; width: 260px; padding: 0 20px; font-size: 19px;
  background: var(--fondo-2); border: 1px solid var(--borde); border-radius: 28px;
  color: var(--texto); outline: none;
}
.buscador::placeholder { color: var(--texto-2); }
.btn-barra {
  width: 56px; height: 56px; font-size: 26px; border-radius: 50%;
  background: var(--fondo-2); border: 1px solid var(--borde); color: var(--texto);
}
.btn-barra:active { background: var(--fondo-3); }
.btn-barra.girando { opacity: .5; }

.seccion { padding: 8px 28px 28px; }
.seccion-titulo { font-size: 21px; font-weight: 700; color: var(--texto-2); margin: 16px 0 14px; }

.rejilla {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.tarjeta { text-align: left; padding: 0; border-radius: 14px; overflow: hidden; background: var(--fondo-2); }
.tarjeta:active { transform: scale(.97); }
.tarjeta-imagen {
  position: relative; width: 100%; padding-top: 56.25%;
  background: var(--fondo-3) center/cover no-repeat;
}
.tarjeta-sin-imagen {
  position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%);
  text-align: center; font-size: 40px; color: var(--borde);
}
.tarjeta-duracion {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0,0,0,.78); color: #fff;
  font-size: 14px; padding: 3px 9px; border-radius: 6px;
}
.tarjeta-barra { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255,255,255,.25); }
.tarjeta-barra i { display: block; height: 100%; background: var(--acento); }
.tarjeta-titulo {
  padding: 12px 14px 16px; font-size: 17px; line-height: 1.3; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.vacio { text-align: center; padding: 80px 28px; color: var(--texto-2); font-size: 20px; }
.vacio-nota { font-size: 16px; }
.vacio code { background: var(--fondo-2); padding: 2px 8px; border-radius: 5px; }

/* ---------- REPRODUCTOR ---------- */
.player { position: fixed; inset: 0; top: 0; left: 0; right: 0; bottom: 0; background: #000; z-index: 50; }
#video { width: 100%; height: 100%; background: #000; display: block; object-fit: contain; }

.controles {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 20px 28px;
  background: linear-gradient(to bottom, rgba(0,0,0,.75) 0%, rgba(0,0,0,0) 28%,
                                          rgba(0,0,0,0) 62%, rgba(0,0,0,.85) 100%);
  transition: opacity .25s;
}
.controles.escondido { opacity: 0; pointer-events: none; }

.controles-arriba { display: flex; align-items: center; gap: 18px; }
.player-titulo { flex: 1; font-size: 21px; font-weight: 600; text-shadow: 0 1px 4px #000; }
.btn-redondo {
  width: var(--toque); height: var(--toque); min-width: var(--toque);
  border-radius: 50%; background: rgba(255,255,255,.14); color: #fff;
  font-size: 26px; font-weight: 700;
}
.btn-redondo:active { background: rgba(255,255,255,.3); }
.btn-redondo.activo { background: var(--acento); }

.controles-centro { display: flex; align-items: center; justify-content: center; gap: 56px; }
.btn-grande {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 96px; height: 96px; border-radius: 50%; line-height: 1;
  background: rgba(255,255,255,.14); color: #fff; font-size: 36px;
}
.btn-grande:active { background: rgba(255,255,255,.3); }
.btn-seg { font-size: 14px; font-weight: 700; margin-top: 3px; }
.btn-play {
  width: 128px; height: 128px; border-radius: 50%;
  background: rgba(255,255,255,.92); color: #000; font-size: 52px;
  display: flex; align-items: center; justify-content: center;
}
.btn-play:active { background: #fff; }

.controles-abajo { display: flex; align-items: center; gap: 18px; }
.tiempo { font-size: 18px; font-variant-numeric: tabular-nums; min-width: 66px; text-align: center; text-shadow: 0 1px 4px #000; }
.progreso { position: relative; flex: 1; height: 44px; display: flex; align-items: center; }
.progreso::before { content: ""; position: absolute; left: 0; right: 0; height: 8px; border-radius: 4px; background: rgba(255,255,255,.3); }
.progreso-relleno { position: absolute; left: 0; height: 8px; border-radius: 4px; background: var(--acento); width: 0; }
.progreso-bola {
  position: absolute; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; left: 0; margin-left: -13px; box-shadow: 0 1px 6px rgba(0,0,0,.6);
}

.cargando { position: absolute; top: 50%; left: 50%; margin: -28px 0 0 -28px; }
.giro {
  width: 56px; height: 56px; border-radius: 50%;
  border: 5px solid rgba(255,255,255,.25); border-top-color: #fff;
  animation: girar .9s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

.reanudar {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.88);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 28px; text-align: center;
}
.reanudar p { font-size: 24px; margin: 0; }
.reanudar-botones { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 420px; }
.btn-ancho {
  height: 76px; border-radius: 14px; font-size: 21px; font-weight: 600;
  background: var(--fondo-3); color: var(--texto); border: 1px solid var(--borde);
}
.btn-ancho:active { background: #2c2c38; }
.btn-primario { background: var(--acento); border-color: var(--acento); color: #fff; }

/* ---------- pantalla trasera de 8 pulgadas ---------- */
@media (max-width: 900px) {
  .barra { padding: 14px 16px 8px; }
  .barra .marca { font-size: 22px; }
  .buscador { width: 150px; height: 50px; font-size: 17px; }
  .seccion { padding: 4px 16px 20px; }
  .rejilla { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .tarjeta-titulo { font-size: 15px; padding: 10px 10px 12px; }
  .controles { padding: 12px 16px; }
  .controles-centro { gap: 28px; }
  .btn-grande { width: 76px; height: 76px; font-size: 34px; }
  .btn-play { width: 96px; height: 96px; font-size: 40px; }
  .btn-redondo { width: 58px; height: 58px; min-width: 58px; font-size: 22px; }
  .player-titulo { font-size: 17px; }
}

/* ---------- subidas ---------- */
.btn-subir { font-size: 34px; font-weight: 300; line-height: 0; }

.panel-subidas { padding: 0 28px; }
.panel-cabecera { display: flex; align-items: center; justify-content: space-between; }
.btn-texto { color: var(--texto-2); font-size: 16px; padding: 10px 4px; text-decoration: underline; }

.lista-trabajos { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.trabajo {
  background: var(--fondo-2); border: 1px solid var(--borde); border-radius: 12px;
  padding: 14px 18px;
}
.trabajo-fila { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.trabajo-nombre {
  font-size: 16px; font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.trabajo-estado { font-size: 14px; color: var(--texto-2); white-space: nowrap; }
.trabajo-estado.error { color: var(--acento); }
.trabajo-estado.listo { color: #3ecf70; }
.trabajo-barra { height: 6px; border-radius: 3px; background: var(--fondo-3); margin-top: 10px; overflow: hidden; }
.trabajo-barra i { display: block; height: 100%; background: var(--acento); width: 0; transition: width .3s; }
.trabajo-barra.terminado i { background: #3ecf70; }

.zona-soltar {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(10,10,12,.92); border: 4px dashed var(--acento);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 700; color: var(--texto);
}
