/* Cinema nel browser: iPhone, iPad e Mac (Safari). Stessa grafica della TV: scuro, Inter, oro. */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --fondo: #050507;
  --testo: #f5f6fa;
  --tenue: rgba(235, 238, 248, 0.68);
  --fioco: rgba(235, 238, 248, 0.42);
  --filo: rgba(255, 255, 255, 0.14);
  --vetro: rgba(255, 255, 255, 0.07);
  --oro: #f5c451;
  --margine: 20px;
  --loc: 118px;                 /* larghezza delle locandine nelle file */
  --sopra: env(safe-area-inset-top, 0px);
  --sotto: env(safe-area-inset-bottom, 0px);
}
@media (min-width: 700px) { :root { --margine: 40px; --loc: 150px; } }
@media (min-width: 1200px) { :root { --margine: 64px; --loc: 176px; } }

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { background: var(--fondo); }
body {
  min-height: 100vh; background: var(--fondo); color: var(--testo);
  font-family: "Inter", -apple-system, system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  font-size: 15px; line-height: 1.45; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }

/* Barra in alto: vetro sopra il contenuto */
#barra {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  padding: calc(var(--sopra) + 10px) var(--margine) 10px;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, rgba(5, 5, 7, 0.86), rgba(5, 5, 7, 0.55));
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.marchio { display: flex; align-items: center; font-weight: 700; letter-spacing: 5px; text-transform: uppercase; font-size: 15px; }
.marchio svg { margin-right: 10px; filter: drop-shadow(0 0 7px rgba(255, 122, 61, 0.55)); }
.nav { display: flex; align-items: center; }
.nav a {
  display: flex; align-items: center; height: 36px; padding: 0 14px; margin-left: 8px; border-radius: 18px;
  font-size: 14px; font-weight: 600; color: var(--tenue); border: 1px solid transparent;
}
.nav a svg { margin-right: 7px; }
.nav a.attivo { color: var(--testo); background: var(--vetro); border-color: var(--filo); }
@media (max-width: 520px) { .nav a span { display: none; } .nav a svg { margin-right: 0; } .nav a { padding: 0 11px; } }

#vista { padding-bottom: calc(var(--sotto) + 40px); }
.pagina-sotto-barra { padding-top: calc(var(--sopra) + 76px); }

/* Eroe della home */
.eroe { position: relative; min-height: 72vh; display: flex; align-items: flex-end; overflow: hidden; }
@media (min-width: 900px) { .eroe { min-height: 78vh; } }
.eroe-sfondo { position: absolute; inset: 0; background: #111 center top / cover no-repeat; }
.eroe::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5, 5, 7, 0.1) 0%, rgba(5, 5, 7, 0.15) 40%, rgba(5, 5, 7, 0.85) 78%, var(--fondo) 100%),
              linear-gradient(90deg, rgba(5, 5, 7, 0.75) 0%, rgba(5, 5, 7, 0) 60%);
}
.eroe-testo { position: relative; z-index: 1; padding: 0 var(--margine) 34px; max-width: 760px; }
.eroe-eti { font-size: 12px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: var(--oro); margin-bottom: 10px; }
.eroe h1 { font-size: clamp(32px, 7vw, 64px); font-weight: 800; letter-spacing: -1.5px; line-height: 1.02; }
.eroe p { margin-top: 12px; color: var(--tenue); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 12px; font-size: 14px; color: var(--tenue); font-weight: 500; }
.meta .voto { color: var(--oro); font-weight: 700; }
.meta .etichetta { padding: 2px 8px; border-radius: 6px; border: 1px solid var(--filo); font-size: 11px; font-weight: 700; letter-spacing: 0.8px; color: var(--testo); }

.tasti { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.tasto {
  display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 22px; border-radius: 23px;
  background: var(--vetro); border: 1px solid var(--filo); font-size: 15px; font-weight: 650; white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease;
}
.tasto svg { margin-right: 9px; flex-shrink: 0; }
.tasto.primo { background: #fff; color: #08080a; border-color: #fff; }
.tasto.primo svg path { fill: #08080a; }
.tasto.tondo { width: 46px; padding: 0; }
.tasto.tondo svg { margin: 0; }
.tasto:active { transform: scale(0.96); }
@media (hover: hover) { .tasto:hover { background: rgba(255, 255, 255, 0.14); } .tasto.primo:hover { background: #e9eaee; } }

/* File di locandine che scorrono di lato */
.fila { margin-top: 28px; }
.fila-testa { display: flex; align-items: baseline; justify-content: space-between; padding: 0 var(--margine); margin-bottom: 12px; }
.fila-titolo { font-size: 18px; font-weight: 700; letter-spacing: -0.2px; }
.fila-testa a { font-size: 13px; color: var(--tenue); font-weight: 600; }
.binario {
  display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden; padding: 4px var(--margine) 10px;
  scroll-snap-type: x proximity; scroll-padding: 0 var(--margine); -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.binario::-webkit-scrollbar { display: none; }
.binario > * { scroll-snap-align: start; flex-shrink: 0; }

.loc {
  position: relative; width: var(--loc); aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden;
  background: #16171c; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); transition: transform 0.2s ease;
}
.loc img { width: 100%; height: 100%; object-fit: cover; }
.loc:active { transform: scale(0.97); }
@media (hover: hover) { .loc:hover { transform: scale(1.04); } }
.loc .scritta {
  position: absolute; inset: 0; padding: 14px 12px; display: flex; flex-direction: column; justify-content: flex-end;
  font-size: 16px; font-weight: 800; line-height: 1.1; letter-spacing: -0.3px;
}
.loc .scritta small { display: block; margin-top: 6px; font-size: 12px; font-weight: 500; opacity: 0.7; }
.loc .bollino {
  position: absolute; top: 8px; left: 8px; padding: 3px 7px; border-radius: 6px; background: var(--oro); color: #111;
  font-size: 10px; font-weight: 800; letter-spacing: 0.6px; max-width: calc(100% - 16px);
}
.loc .qualita {
  position: absolute; top: 8px; right: 8px; padding: 2px 6px; border-radius: 5px; background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.25); font-size: 10px; font-weight: 800; letter-spacing: 0.6px;
}
.loc .avanzamento { position: absolute; left: 10px; right: 10px; bottom: 10px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.25); }
.loc .avanzamento div { height: 100%; border-radius: 2px; background: var(--oro); }
.loc .quale-ep { position: absolute; left: 8px; bottom: 20px; padding: 3px 7px; border-radius: 6px; background: rgba(0, 0, 0, 0.72); font-size: 11px; font-weight: 800; letter-spacing: 0.6px; }
.loc .visto { position: absolute; right: 8px; bottom: 8px; width: 24px; height: 24px; border-radius: 12px; background: rgba(0, 0, 0, 0.72); display: flex; align-items: center; justify-content: center; }
.loc .quanti { position: absolute; left: 8px; bottom: 8px; padding: 3px 7px; border-radius: 6px; background: rgba(0, 0, 0, 0.72); color: var(--oro); font-size: 10px; font-weight: 800; letter-spacing: 0.6px; }

/* Griglia (Tutti i film, Cerca, Saga) */
.griglia {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--loc), 1fr)); gap: 18px 12px; padding: 0 var(--margine);
}
.griglia .loc { width: 100%; }
.titolo-pagina { padding: 0 var(--margine); font-size: clamp(26px, 5vw, 40px); font-weight: 800; letter-spacing: -1px; }
.sotto-titolo { padding: 4px var(--margine) 0; color: var(--tenue); font-size: 14px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 16px var(--margine) 18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; height: 34px; padding: 0 15px; border-radius: 17px; background: var(--vetro); border: 1px solid var(--filo);
  font-size: 13px; font-weight: 600; color: var(--tenue);
}
.chip.attivo { color: var(--oro); border-color: var(--oro); }
.chip-sep { flex-shrink: 0; width: 1px; margin: 6px 6px; background: var(--filo); }
.vuoto { padding: 30px var(--margine); color: var(--tenue); }

/* Cerca */
.campo {
  display: flex; align-items: center; margin: 14px var(--margine) 20px; height: 50px; padding: 0 16px; border-radius: 16px;
  background: var(--vetro); border: 1px solid var(--filo);
}
.campo input { flex: 1; margin-left: 10px; background: none; border: 0; outline: 0; color: var(--testo); font: inherit; font-size: 17px; }
.campo input::placeholder { color: var(--fioco); }

/* Scheda del film e della serie */
.scheda-alto { position: relative; height: 56vh; min-height: 300px; max-height: 620px; overflow: hidden; }
.scheda-alto .eroe-sfondo { opacity: 0.9; }
.scheda-alto::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 5, 7, 0.2), rgba(5, 5, 7, 0.4) 50%, var(--fondo)); }
.scheda-corpo { position: relative; z-index: 1; margin-top: -170px; padding: 0 var(--margine); display: flex; gap: 26px; align-items: flex-end; }
.scheda-corpo .loc { width: 150px; flex-shrink: 0; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6); }
@media (max-width: 600px) { .scheda-corpo { flex-direction: column; align-items: flex-start; margin-top: -120px; gap: 16px; } .scheda-corpo .loc { width: 110px; } }
@media (min-width: 1000px) { .scheda-corpo .loc { width: 220px; } }
.scheda-testi h1 { font-size: clamp(28px, 5.5vw, 52px); font-weight: 800; letter-spacing: -1.2px; line-height: 1.05; }
.frase { margin-top: 6px; color: var(--oro); font-style: italic; font-size: 15px; }
.scheda-resto { padding: 0 var(--margine); max-width: 980px; }
.trama { margin-top: 20px; color: var(--tenue); font-size: 15.5px; line-height: 1.6; }
.persone { margin-top: 14px; font-size: 14px; color: var(--fioco); }
.persone b { color: var(--tenue); font-weight: 600; }
.tecnica { margin-top: 14px; font-size: 12.5px; color: var(--fioco); }

/* Serie: stagioni ed episodi */
.episodi { padding: 0 var(--margine); display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .episodi { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1400px) { .episodi { grid-template-columns: 1fr 1fr 1fr; } }
.episodio { display: flex; gap: 14px; padding: 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.06); text-align: left; }
@media (hover: hover) { .episodio:hover { background: rgba(255, 255, 255, 0.08); } }
.episodio-foto { position: relative; width: 150px; aspect-ratio: 16 / 9; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: #16171c center / cover no-repeat; }
.episodio-foto .avanzamento { position: absolute; left: 8px; right: 8px; bottom: 7px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.3); }
.episodio-foto .avanzamento div { height: 100%; border-radius: 2px; background: var(--oro); }
.episodio-foto .gioca { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.2); }
.episodio-testi { min-width: 0; }
.episodio-num { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--oro); }
.episodio-num .nuovo { margin-left: 6px; padding: 1px 6px; border-radius: 5px; background: var(--oro); color: #111; }
.episodio-num .visto-e { margin-left: 6px; color: var(--fioco); }
.episodio-nome { margin-top: 2px; font-size: 15px; font-weight: 700; }
.episodio-trama { margin-top: 4px; font-size: 13px; color: var(--tenue); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Trailer */
#trailer { position: fixed; inset: 0; z-index: 60; background: #000; }
#trailer iframe { width: 100%; height: 100%; border: 0; }
#trailer .chiudi { position: absolute; top: calc(var(--sopra) + 14px); right: 14px; }

/* Lettore */
#lettore { position: fixed; inset: 0; z-index: 50; background: #000; user-select: none; -webkit-user-select: none; }
#lettore video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
#sub { position: absolute; inset: 0; pointer-events: none; }
#sub .testo-sub {
  position: absolute; left: 6%; right: 6%; bottom: 7%; text-align: center; font-size: clamp(17px, 3.4vw, 34px);
  font-weight: 600; line-height: 1.3; text-shadow: 0 0 4px #000, 0 2px 3px #000, 0 0 2px #000; white-space: pre-line;
}
#sub img { position: absolute; }
.comandi { position: absolute; inset: 0; transition: opacity 0.25s ease; }
#lettore.nascosti .comandi { opacity: 0; pointer-events: none; }
#lettore.nascosti { cursor: none; }
.comandi-velo { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.75)); }
.comandi-alto { position: absolute; top: 0; left: 0; right: 0; padding: calc(var(--sopra) + 14px) calc(var(--margine) - 6px) 0; display: flex; align-items: center; gap: 12px; }
.comandi-titolo { min-width: 0; }
.comandi-titolo b { display: block; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comandi-titolo span { font-size: 13px; color: var(--tenue); }
.tondo-vetro { width: 44px; height: 44px; border-radius: 22px; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.35); flex-shrink: 0; }
.comandi-centro { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 34px; }
.comandi-centro .grande { width: 76px; height: 76px; border-radius: 38px; background: rgba(0, 0, 0, 0.4); display: flex; align-items: center; justify-content: center; }
.comandi-basso { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 var(--margine) calc(var(--sotto) + 16px); }
.tempo { display: flex; align-items: center; gap: 12px; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--tenue); }
.barra-tempo { position: relative; flex: 1; height: 28px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.barra-tempo .rotaia { position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.25); }
.barra-tempo .pronto { position: absolute; left: 0; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.35); }
.barra-tempo .fatto { position: absolute; left: 0; height: 4px; border-radius: 2px; background: var(--oro); }
.barra-tempo .pomello { position: absolute; width: 16px; height: 16px; margin-left: -8px; border-radius: 8px; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); }
.barra-tempo .salto { position: absolute; bottom: 26px; transform: translateX(-50%); padding: 3px 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.75); color: var(--oro); font-weight: 700; font-size: 12px; white-space: nowrap; }
.comandi-tasti { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
#attesa { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.18); border-top-color: #fff; animation: giro 0.9s linear infinite; pointer-events: none; }
@keyframes giro { to { transform: rotate(360deg); } }

.pillola {
  position: absolute; right: var(--margine); bottom: calc(var(--sotto) + 110px); height: 46px; padding: 0 20px; border-radius: 23px;
  background: rgba(255, 255, 255, 0.94); color: #08080a; font-weight: 700; font-size: 15px;
}
.menu {
  position: absolute; right: var(--margine); bottom: calc(var(--sotto) + 100px); width: min(340px, calc(100% - 2 * var(--margine)));
  max-height: 60vh; overflow-y: auto; padding: 10px; border-radius: 20px; background: rgba(18, 19, 24, 0.95); border: 1px solid var(--filo);
}
.menu h4 { padding: 8px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--fioco); }
.menu button { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 11px 12px; border-radius: 12px; text-align: left; font-size: 15px; }
.menu button.attiva::after { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--oro); }
@media (hover: hover) { .menu button:hover { background: rgba(255, 255, 255, 0.08); } }

.prossimo {
  position: absolute; right: var(--margine); bottom: calc(var(--sotto) + 100px); width: min(420px, calc(100% - 2 * var(--margine)));
  display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 20px; background: rgba(14, 15, 20, 0.94); border: 1px solid var(--filo);
}
.prossimo-foto { width: 120px; aspect-ratio: 16 / 9; border-radius: 10px; background: #16171c center / cover no-repeat; flex-shrink: 0; }
.prossimo-eti { font-size: 11px; font-weight: 800; letter-spacing: 1.5px; color: var(--oro); text-transform: uppercase; }
.prossimo-nome { font-size: 15px; font-weight: 700; margin-top: 2px; }
.prossimo-tasti { display: flex; gap: 8px; margin-top: 8px; }
.prossimo-tasti .tasto { height: 36px; padding: 0 14px; font-size: 13px; }

#avviso {
  position: fixed; left: 50%; bottom: calc(var(--sotto) + 24px); transform: translateX(-50%) translateY(20px); z-index: 80;
  padding: 12px 20px; border-radius: 22px; background: rgba(18, 19, 24, 0.96); border: 1px solid var(--filo); font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease; max-width: calc(100% - 40px); text-align: center;
}
#avviso.su { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Accesso da fuori casa */
.accesso { max-width: 360px; margin: 0 auto; padding-left: var(--margine); padding-right: var(--margine); display: flex; flex-direction: column; align-items: center; text-align: center; }
.accesso img { width: 84px; height: 84px; border-radius: 20px; margin-top: 8vh; box-shadow: 0 10px 40px rgba(255, 122, 61, 0.25); }
.accesso h1 { margin-top: 16px; font-size: 30px; font-weight: 800; letter-spacing: 4px; text-transform: uppercase; }
.accesso p { margin: 8px 0 22px; color: var(--tenue); }
.accesso input, .form-password input {
  width: 100%; height: 50px; padding: 0 16px; border-radius: 14px; background: var(--vetro); border: 1px solid var(--filo);
  color: var(--testo); font: inherit; font-size: 17px; outline: 0; margin-bottom: 10px;
}
.accesso .tasto, .form-password .tasto { width: 100%; margin-top: 6px; }
.accesso-errore { min-height: 20px; color: #ff8a7a; font-size: 14px; margin-bottom: 6px; }
.form-password { max-width: 380px; margin-top: 14px; }
.link-fuori { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 12px 12px 12px 18px;
  border-radius: 16px; background: var(--vetro); border: 1px solid var(--filo); font-weight: 700; word-break: break-all; }
