/* =========================================================
   SEZIONI FILM / SERIE TV
   ========================================================= */

:root {
  --gold: #f5c518;
  --gold-soft: #ffe07a;
  --red: #e5484d;
  --green: #30a46c;
  --panel: #14141a;
  --menu: #1a1a21;
  --row-h: 76px;           /* se la cambi, aggiorna ROW_H in js/section.js */
}

.view--film  { --accent: var(--film);  --accent-rgb: 229, 9, 20;
               background: radial-gradient(ellipse 80% 55% at 50% -10%, rgba(229, 9, 20, .14), transparent 70%), var(--bg); }
.view--serie { --accent: #5b6cff;      --accent-rgb: 91, 108, 255;
               background: radial-gradient(ellipse 80% 55% at 50% -10%, rgba(99, 102, 241, .17), transparent 70%), var(--bg); }

.section-shell {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px clamp(16px, 4vw, 64px) 26px;
}

.topbar, .toolbar, .list-panel {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}

/* ---------------- header ---------------- */

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .9);
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  letter-spacing: .05em;
  line-height: 1;
  padding: 3px 8px 0 4px;
  white-space: nowrap;
}

.round-btn {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .05);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.round-btn:hover { background: rgba(255, 255, 255, .12); }
.round-btn:active { transform: scale(.94); }

/* caselle di testo */
.field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--border);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.field:focus-within {
  border-color: rgba(var(--accent-rgb), .7);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18);
  background: rgba(0, 0, 0, .4);
}
.field > .ic { color: var(--muted); }
.field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 500 .95rem var(--font-body);
}
.field input::placeholder { color: rgba(255, 255, 255, .38); }

.field { min-width: 0; }
.field input { width: 0; }       /* niente larghezza "naturale": decide il flex */
.field--add    { flex: 1.5 1 200px; }
.field--search { flex: 1 1 150px; }

/* finestre medie: l'ordinamento mostra solo l'icona, così l'header resta su una riga */
@media (max-width: 1180px) {
  .btn-sort .sort-label { display: none; }
  .btn-sort { padding: 0 12px; }
}

.field .spinner { display: none; }
.field.is-busy .spinner { display: block; }

.kbd-hint {
  font: 600 .72rem var(--font-body);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}
.field-clear {
  display: none;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  cursor: pointer;
  place-items: center;
}
.field-clear .ic { width: 14px; height: 14px; }
.field--search.has-value .field-clear { display: grid; }
.field--search.has-value .kbd-hint,
.field--search:focus-within .kbd-hint { display: none; }

/* pulsanti */
.btn {
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: .92rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s var(--ease), transform .15s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.btn:active { transform: scale(.97); }
.btn--primary {
  background: var(--accent);
  box-shadow: 0 10px 30px -14px rgba(var(--accent-rgb), .9);
}
.btn--primary:hover { filter: brightness(1.12); }
.btn--ghost {
  background: rgba(255, 255, 255, .05);
  border-color: var(--border);
  color: var(--text);
}
.btn--ghost:hover { background: rgba(255, 255, 255, .1); }
.ic--sm { width: .9em; height: .9em; opacity: .7; }

/* ---------------- menu a tendina ---------------- */

.dd { position: relative; }
.dd-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 250px;
  padding: 6px;
  border-radius: 14px;
  background: var(--menu);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .8);
  opacity: 0;
  transform: translateY(-6px) scale(.98);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity .16s var(--ease), transform .16s var(--ease);
}
.dd.is-open .dd-menu {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.dd-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  font-size: .9rem;
  cursor: pointer;
}
.dd-item[hidden] { display: none; }
.dd-item:hover { background: rgba(255, 255, 255, .07); }
.dd-item .ic { color: var(--muted); }
.dd-check { visibility: hidden; }
.dd-item.is-selected { color: #fff; font-weight: 600; }
.dd-item.is-selected .dd-check { visibility: visible; color: var(--accent); }
.dd-sep { height: 1px; margin: 6px 8px; background: rgba(255, 255, 255, .08); }

/* ---------------- barra schede ---------------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 0 4px;
}

.tabs {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--border);
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.tab:hover { color: var(--text); }
.tab.is-active {
  background: rgba(var(--accent-rgb), .22);
  color: #fff;
}
.tab .count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  font-size: .75rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.stats {
  color: var(--muted);
  font-size: .9rem;
}
.stats b { color: var(--text); font-weight: 600; }
.gold { color: var(--gold); }

.save-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: .8rem;
}
.save-status[hidden] { display: none; }
.save-status .ic { width: 14px; height: 14px; }
.save-status.is-on .ic { color: #4cc38a; }
.save-status.is-paused, .save-status.is-error {
  color: #ffcf6b;
  border-color: rgba(255, 207, 107, .35);
  background: rgba(255, 207, 107, .08);
  cursor: pointer;
}
.save-status.is-error { color: #ff8b8f; border-color: rgba(255, 139, 143, .35); background: rgba(255, 139, 143, .08); }

/* ---------------- pannello lista ---------------- */

.list-panel {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--border);
  overflow: hidden;
}

.list-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 10px 14px 14px;
  scrollbar-gutter: stable;
}

/* barra di scorrimento sottile */
.list-scroll::-webkit-scrollbar { width: 10px; }
.list-scroll::-webkit-scrollbar-track { background: transparent; }
.list-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .14);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.list-scroll::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, .26); }

.list-spacer { position: relative; }

.list-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
  pointer-events: none;
}
.list-empty[hidden] { display: none; }
.list-empty p { margin: 0; }
.ic--xl { width: 48px; height: 48px; stroke-width: 1.2; opacity: .5; }

/* ---------------- riga ---------------- */

.row {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--row-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 14px 0 11px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .06);
  transition: background .2s var(--ease), border-color .2s var(--ease), opacity .22s var(--ease), transform .26s var(--ease);
}
.row:hover {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .1);
}
.row.is-editing {
  background: rgba(var(--accent-rgb), .1);
  border-color: rgba(var(--accent-rgb), .45);
}
.row.is-new { animation: row-flash 1.6s var(--ease); }
@keyframes row-flash {
  0%, 30% { background: rgba(var(--accent-rgb), .25); border-color: rgba(var(--accent-rgb), .8); }
}
.row.is-leaving { opacity: 0; transform: scale(.97); }
.row.is-moving  { opacity: 0; transform: translateX(40px); }

/* locandina rotonda */
.poster {
  flex: none;
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .14);
  background: linear-gradient(160deg, #2a2a33, #15151b);
  display: grid;
  place-items: center;
  cursor: zoom-in;
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}
.poster:hover {
  transform: scale(1.14);
  border-color: rgba(var(--accent-rgb), .9);
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .9);
}
.poster--empty { cursor: default; color: rgba(255, 255, 255, .35); }
.poster--empty:hover { transform: none; border-color: rgba(255, 255, 255, .14); box-shadow: none; }
.poster--empty .ic { width: 22px; height: 22px; }

/* nome */
.row-main { flex: 1; min-width: 0; }
.row-name {
  font-weight: 600;
  font-size: 1.02rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-meta {
  margin-top: 3px;
  font-size: .8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-edit {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(var(--accent-rgb), .6);
  background: rgba(0, 0, 0, .35);
  color: var(--text);
  font: 600 1rem var(--font-body);
  outline: none;
}

/* stelle */
.stars-wrap {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.stars {
  position: relative;
  display: flex;
  cursor: pointer;
  border-radius: 6px;
  outline: none;
}
.stars:focus-visible { box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .7); }
.stars-base, .stars-fill { display: flex; }
.stars-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
  transition: width .12s ease-out;
}
.star {
  flex: none;
  width: 26px;
  height: 26px;
  stroke-width: 1.4;
  stroke-linejoin: round;
}
.stars-base .star { fill: none; stroke: rgba(255, 255, 255, .3); }
.stars-fill .star { fill: var(--gold); stroke: var(--gold); }
.stars.is-preview .stars-fill .star { fill: var(--gold-soft); stroke: var(--gold-soft); }
.stars-val {
  width: 2.2em;
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* pulsanti tondi */
.row-actions {
  flex: none;
  display: flex;
  gap: 8px;
}
.act {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .2s var(--ease), transform .15s var(--ease), color .2s;
}
.act:active { transform: scale(.9); }
.act .ic { width: 18px; height: 18px; }
.act--edit { background: rgba(255, 255, 255, .08); }
.act--edit:hover { background: rgba(255, 255, 255, .16); }
.act--save { background: rgba(var(--accent-rgb), .85); }
.act--del { background: var(--red); color: #fff; }
.act--del:hover { background: #f2555a; transform: scale(1.06); }
.act--seen { background: rgba(48, 164, 108, .18); color: #4cc38a; }
.act--seen:hover { background: var(--green); color: #fff; }

/* ---------------- suggerimenti TMDB ---------------- */

.suggest {
  position: fixed;
  z-index: 100;
  overflow-y: auto;
  padding: 6px;
  border-radius: 14px;
  background: var(--menu);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, .85);
}
.suggest[hidden] { display: none; }
.sg-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
}
.sg-item.is-active { background: rgba(255, 255, 255, .08); }
.sg-item img, .sg-noimg {
  flex: none;
  width: 38px;
  height: 57px;
  border-radius: 6px;
  object-fit: cover;
  background: #23232b;
}
.sg-noimg { display: grid; place-items: center; color: rgba(255, 255, 255, .3); }
.sg-text { min-width: 0; }
.sg-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-meta { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.sg-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: var(--muted);
  font-size: .9rem;
}
.sg-info code { color: var(--text); }
.sg-foot {
  padding: 8px 10px 4px;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: .75rem;
  color: rgba(255, 255, 255, .4);
}

/* ---------------- anteprima locandina ---------------- */

.pp {
  position: fixed;
  z-index: 90;
  width: 220px;
  border-radius: 14px;
  overflow: hidden;
  background: #111;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 30px 80px -10px rgba(0, 0, 0, .9);
  pointer-events: none;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .18s var(--ease), transform .22s var(--ease);
}
.pp.is-open { opacity: 1; transform: scale(1); }
.pp img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: #1c1c22;
}
.pp-cap {
  padding: 9px 12px 10px;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.35;
}

/* ---------------- avvisi ---------------- */

#toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 11px 12px 11px 16px;
  border-radius: 14px;
  background: #212129;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 20px 50px -15px rgba(0, 0, 0, .8);
  font-size: .9rem;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.is-in { opacity: 1; transform: none; }
.toast-btn {
  flex: none;
  padding: 6px 12px;
  border-radius: 9px;
  border: 0;
  background: rgba(255, 255, 255, .1);
  font-weight: 700;
  font-size: .85rem;
  color: var(--gold);
  cursor: pointer;
}
.toast-btn:hover { background: rgba(255, 255, 255, .18); }

/* ---------------- indicatore di caricamento ---------------- */

.spinner {
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .2);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- schermi piccoli ---------------- */

@media (max-width: 760px) {
  .section-shell { padding: 14px 12px 16px; gap: 10px; }
  .topbar-title { display: none; }
  .field--add, .field--search { flex-basis: 100%; }
  .row { gap: 10px; padding: 0 8px; }
  .row-meta { display: none; }
  .star { width: 19px; height: 19px; }
  .stars-val { display: none; }
  .act { width: 34px; height: 34px; }
}

/* =========================================================
   PASSO 3 — pulsanti HOME / altra sezione, filtri, scheda
   ========================================================= */

/* ---------------- HOME  ←   /   → SERIE TV ---------------- */

.nav-btn {
  flex: none;
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .05);
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.nav-btn span { padding-top: 3px; }         /* il Bebas siede un po' alto */
.nav-btn .ic { transition: transform .25s var(--ease); }
.nav-btn--home { padding-left: 12px; }
.nav-btn--next { padding-right: 12px; }
.nav-btn--home:hover .ic { transform: translateX(-4px); }
.nav-btn--next:hover .ic { transform: translateX(4px); }
.nav-btn:active { transform: scale(.97); }

.nav-btn--home:hover {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .22);
}
/* il pulsante verso l'altra sezione prende il colore della sezione di arrivo */
.nav-btn--next[data-go="serie"]:hover {
  background: rgba(91, 108, 255, .22);
  border-color: rgba(91, 108, 255, .6);
  box-shadow: 0 10px 30px -14px rgba(91, 108, 255, .9);
}
.nav-btn--next[data-go="film"]:hover {
  background: rgba(229, 9, 20, .2);
  border-color: rgba(229, 9, 20, .6);
  box-shadow: 0 10px 30px -14px rgba(229, 9, 20, .9);
}

/* ---------------- filtri ---------------- */

.toolbar { position: relative; z-index: 15; }
.dd--filters { margin-left: auto; }
.save-status:not([hidden]) ~ .dd--filters { margin-left: 0; }

.btn--sm { height: 36px; padding: 0 12px; border-radius: 10px; font-size: .85rem; }
.btn-filters.is-active {
  border-color: rgba(var(--accent-rgb), .6);
  background: rgba(var(--accent-rgb), .14);
}
.badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: .7rem;
  display: inline-grid;
  place-items: center;
}
.badge[hidden] { display: none; }

.dd-menu--form {
  width: 320px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.fl-group[hidden] { display: none; }
.fl-label {
  margin-bottom: 8px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.fl-row { display: flex; align-items: center; gap: 8px; }
.fl-dash { color: var(--muted); }
.fl-input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, .3);
  color: var(--text);
  font: 500 .92rem var(--font-body);
  outline: none;
}
.fl-input:focus { border-color: rgba(var(--accent-rgb), .7); }
.fl-input::-webkit-inner-spin-button { opacity: .4; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .04);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.chip:hover { background: rgba(255, 255, 255, .09); }
.chip.is-selected {
  background: rgba(var(--accent-rgb), .22);
  border-color: rgba(var(--accent-rgb), .7);
  color: #fff;
}

.fl-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
  cursor: pointer;
}
.fl-check input { width: 16px; height: 16px; accent-color: var(--accent); }

.fl-reset {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: .85rem;
  cursor: pointer;
}
.fl-reset:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.fl-reset .ic { width: 14px; height: 14px; }

.stats-reset {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.view--serie .stats-reset { color: #8f9bff; }

/* nome cliccabile */
.row-name { cursor: pointer; display: inline-block; max-width: 100%; vertical-align: top; outline: none; }
.row-name:hover, .row-name:focus-visible { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255, 255, 255, .4); }
.row-meta { display: block; }

/* ---------------- scheda di dettaglio ---------------- */

.dt-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 4, 7, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .22s var(--ease);
}
.dt-overlay[hidden] { display: none; }
.dt-overlay.is-open { opacity: 1; }
.dt--film  { --accent: var(--film); --accent-rgb: 229, 9, 20; }
.dt--serie { --accent: #5b6cff;     --accent-rgb: 91, 108, 255; }

.dt-panel {
  position: relative;
  width: min(920px, 100%);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 22px;
  background: #121217;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .95);
  transform: translateY(18px) scale(.98);
  transition: transform .28s var(--ease);
}
.dt-overlay.is-open .dt-panel { transform: none; }
.dt-panel::-webkit-scrollbar { width: 10px; }
.dt-panel::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

.dt-close {
  position: sticky;
  top: 14px;
  float: right;
  margin: 14px 14px -56px 0;
  z-index: 3;
  background: rgba(10, 10, 14, .6);
  backdrop-filter: blur(8px);
}

.dt-hero {
  height: 260px;
  background:
    linear-gradient(to bottom, rgba(18, 18, 23, .1) 0%, rgba(18, 18, 23, .55) 60%, #121217 100%),
    var(--backdrop) center 25% / cover no-repeat;
  border-radius: 22px 22px 0 0;
}
.dt-hero--empty {
  height: 150px;
  background: radial-gradient(ellipse 80% 120% at 30% 0%, rgba(var(--accent-rgb), .35), transparent 70%);
}

.dt-head {
  position: relative;
  display: flex;
  gap: 28px;
  padding: 0 32px;
  margin-top: -130px;
}
.dt-hero--empty + .dt-head { margin-top: -70px; }

.dt-poster {
  flex: none;
  width: 180px;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  overflow: hidden;
  background: #1d1d24;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, .9);
}
.dt-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dt-poster-empty { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(255, 255, 255, .25); }
.dt-poster-empty .ic { width: 48px; height: 48px; stroke-width: 1.2; }

.dt-headinfo {
  flex: 1;
  min-width: 0;
  padding-top: 70px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dt-hero--empty + .dt-head .dt-headinfo { padding-top: 20px; }

.dt-kicker {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.dt-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  line-height: .95;
  letter-spacing: .02em;
}
.dt-orig { color: var(--muted); font-style: italic; margin-top: -4px; }

.dt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dt-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .08);
  font-size: .8rem;
  font-weight: 500;
}
.dt-chip--vote { background: rgba(245, 197, 24, .12); border-color: rgba(245, 197, 24, .3); }
.dt-chip--vote .ic { width: 13px; height: 13px; fill: var(--gold); stroke: var(--gold); }
.dt-chip small { color: var(--muted); font-size: .7rem; }

.dt-user {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.dt-user-label { font-size: .85rem; color: var(--muted); }
.dt-user .star { width: 28px; height: 28px; }

.btn--seen { background: rgba(48, 164, 108, .18); color: #4cc38a; border-color: rgba(48, 164, 108, .4); height: 38px; }
.btn--seen:hover { background: var(--green); color: #fff; }

.dt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.dt-actions .btn { text-decoration: none; color: var(--text); height: 38px; }

.dt-sections {
  padding: 26px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.dt-tagline { margin: 0; font-style: italic; color: var(--muted); font-size: 1.02rem; }
.dt-sec h3 {
  margin: 0 0 10px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.dt-sec h3 small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.dt-sec h4 { margin: 0 0 4px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.dt-sec p { margin: 0; }
.dt-overview { line-height: 1.65; font-size: .98rem; max-width: 72ch; }

.dt-people { display: flex; flex-wrap: wrap; gap: 14px 40px; }
.dt-people p { font-weight: 600; }

.dt-cast {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.dt-person { flex: none; width: 96px; text-align: center; }
.dt-face {
  width: 76px;
  height: 76px;
  margin: 0 auto 8px;
  border-radius: 50%;
  overflow: hidden;
  background: #22222a;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .3);
  border: 2px solid rgba(255, 255, 255, .1);
}
.dt-face img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.dt-face .ic { width: 30px; height: 30px; }
.dt-pname { font-size: .82rem; font-weight: 600; line-height: 1.25; }
.dt-prole { font-size: .75rem; color: var(--muted); line-height: 1.25; margin-top: 2px; }

.dt-provgroup + .dt-provgroup { margin-top: 12px; }
.dt-provs { display: flex; flex-wrap: wrap; gap: 8px; }
.dt-prov img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: block;
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .9);
}
.dt-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--text);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
}
.dt-link:hover { text-decoration: underline; }
.dt-link .ic { width: 14px; height: 14px; }
.dt-attrib { margin-top: 10px !important; font-size: .72rem; color: rgba(255, 255, 255, .38); }
.dt-muted { color: var(--muted); }

.dt-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 0 10px;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}
.dt-msg p { margin: 0; }

/* scheletro durante il caricamento */
.sk {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .05) 25%, rgba(255, 255, 255, .11) 50%, rgba(255, 255, 255, .05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
.sk--title { width: 30%; height: 12px; }
.sk--short { width: 55%; }
.sk-row { display: flex; gap: 14px; margin-top: 8px; }
.sk--face { width: 76px; height: 76px; border-radius: 50%; }
.dt-loading { gap: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 760px) {
  .dt-overlay { padding: 10px; }
  .dt-head { flex-direction: column; gap: 16px; padding: 0 18px; margin-top: -110px; }
  .dt-poster { width: 130px; }
  .dt-headinfo { padding-top: 0; }
  .dt-sections { padding: 20px 18px 24px; }
  .nav-btn { font-size: 1.2rem; padding: 0 10px; }
}

/* ---------------- filtro per generi ---------------- */

.dd-menu--form { width: 380px; max-height: calc(100vh - 220px); overflow-y: auto; }

.fl-label--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.seg {
  display: inline-flex;
  padding: 2px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--border);
  text-transform: none;
  letter-spacing: 0;
}
.seg-btn {
  padding: 3px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
}
.seg-btn.is-selected { background: rgba(var(--accent-rgb), .3); color: #fff; }

.chips--generi { max-height: 190px; overflow-y: auto; padding-right: 2px; }
.chip-n {
  margin-left: 2px;
  font-size: .72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.chip.is-selected .chip-n { color: rgba(255, 255, 255, .75); }
.fl-empty { font-size: .85rem; color: var(--muted); }
.fl-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: .78rem;
  color: var(--muted);
}
.fl-note[hidden] { display: none; }
.fl-note .spinner { width: 12px; height: 12px; }

/* =========================================================
   FINESTRE: "Le mie piattaforme" e "Cosa guardo stasera?"
   ========================================================= */

.md-overlay {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 4, 7, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .22s var(--ease);
  --accent: #8a8aa0; --accent-rgb: 138, 138, 160;
}
.md-overlay[hidden] { display: none; }
.md-overlay.is-open { opacity: 1; }
.md--film  { --accent: var(--film); --accent-rgb: 229, 9, 20; }
.md--serie { --accent: #5b6cff;     --accent-rgb: 91, 108, 255; }

.md-panel {
  position: relative;
  width: min(460px, 100%);
  max-height: 100%;
  overflow-y: auto;
  border-radius: 22px;
  background: #121217;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .95);
  transform: translateY(18px) scale(.98);
  transition: transform .28s var(--ease);
}
.md-overlay.is-open .md-panel { transform: none; }
.md--wide .md-panel { width: min(760px, 100%); }
.md-close { position: absolute; top: 14px; right: 14px; z-index: 2; background: rgba(10, 10, 14, .6); }

.md-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.2rem;
  letter-spacing: .03em;
  line-height: 1;
}
.md-sub { margin: 8px 0 0; color: var(--muted); line-height: 1.55; font-size: .92rem; max-width: 60ch; }
.md-sub b { color: var(--text); }

/* ---------------- piattaforme ---------------- */

.pf { padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.pf-search { max-width: 340px; }
.pf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 4px;
}
.pf-grid::-webkit-scrollbar { width: 8px; }
.pf-grid::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); border-radius: 8px; }
.pf-grid .sg-info { grid-column: 1 / -1; }
.pf-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
  text-align: left;
  font-size: .86rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.pf-item:hover { background: rgba(255, 255, 255, .07); }
.pf-item img { width: 34px; height: 34px; border-radius: 8px; flex: none; background: #222; }
.pf-item span { min-width: 0; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pf-check {
  margin-left: auto;
  width: 18px;
  height: 18px;
  padding: 2px;
  border-radius: 50%;
  color: transparent;
  border: 1.5px solid rgba(255, 255, 255, .25);
}
.pf-item.is-selected { border-color: rgba(76, 195, 138, .7); background: rgba(48, 164, 108, .14); }
.pf-item.is-selected .pf-check { color: #fff; background: var(--green); border-color: var(--green); }
.pf-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pf-count { color: var(--muted); font-size: .88rem; }

/* loghi nella riga "Da vedere" */
.row-avail { flex: none; display: flex; gap: 6px; }
.row-avail img { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .9); }

/* le mie piattaforme evidenziate nella scheda */
.dt-prov { position: relative; display: inline-block; border-radius: 12px; }
.dt-prov.is-mine { box-shadow: 0 0 0 2px #4cc38a; }
.dt-prov.is-mine::after {
  content: '';
  position: absolute;
  right: -5px;
  top: -5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #4cc38a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 10px no-repeat;
  border: 2px solid #121217;
}

.fl-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.fl-link[hidden], .fl-check[hidden] { display: none; }
.fl-link .ic { width: 16px; height: 16px; }

/* ---------------- cosa guardo stasera ---------------- */

.btn-pick[hidden] { display: none; }
.btn-pick .ic { color: var(--gold); }
.btn-pick:hover .ic { animation: dice-wobble .5s var(--ease); }
@keyframes dice-wobble { 30% { transform: rotate(-18deg); } 65% { transform: rotate(12deg); } }

.md--picker .md-panel { width: min(420px, 100%); }
.pk {
  padding: 30px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}
.pk-card {
  width: 210px;
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  overflow: hidden;
  background: #1d1d24;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .95);
}
.pk-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pk-card.is-final {
  animation: pk-pop .5s var(--ease);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .8), 0 30px 70px -18px rgba(var(--accent-rgb), .55);
}
@keyframes pk-pop { 0% { transform: scale(.9); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
.pk-noimg {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  color: var(--muted);
  font-weight: 600;
}
.pk-noimg .ic { width: 44px; height: 44px; stroke-width: 1.2; opacity: .5; }

.pk-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 60px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.pk-info.is-in { opacity: 1; transform: none; }
.pk-kicker { font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pk-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.3rem;
  line-height: 1;
  letter-spacing: .02em;
}
.pk-meta { color: var(--muted); font-size: .9rem; }
.pk-avail {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: .85rem;
  color: #4cc38a;
  font-weight: 600;
}
.pk-avail img { width: 30px; height: 30px; border-radius: 8px; }
.pk-avail--no { color: var(--muted); font-weight: 500; }
.pk-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }

/* avanzamento collegamento TMDB */
.link-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: var(--muted);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}
.link-status[hidden] { display: none; }
.link-status .spinner { width: 12px; height: 12px; }

.link-status.is-error { color: #ff8b8f; background: rgba(255, 139, 143, .1); }
.link-status .ic { width: 14px; height: 14px; }

.btn--danger { background: var(--red); color: #fff; }
.btn--danger:hover { background: #f2555a; }
.btn--danger:disabled { opacity: .6; cursor: default; }
.md--confirm .pf-foot { justify-content: flex-end; }

/* crediti TMDB (richiesti dai termini d'uso) in fondo al menu ⋮ */
.dd-credits {
  padding: 6px 12px 4px;
  font-size: .72rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, .38);
}

/* =========================================================
   SFONDI A TEMA DELLE SEZIONI
   Film: pellicola che scorre ai lati, grana e luce di proiettore
   Serie TV: vecchio schermo con righe, banda che scorre e bagliore blu
   ========================================================= */

.view--film  { background: #0b0909; }
.view--serie { background: #08090f; }

.section-shell { z-index: 1; }

.deco {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* animazioni ferme quando la sezione non è visibile */
.view:not(.is-active) .deco * { animation-play-state: paused !important; }

/* ---------------- FILM: pellicola ---------------- */

.deco-light {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 55% at 50% -8%, rgba(229, 9, 20, .20), transparent 70%),
    radial-gradient(ellipse 120% 80% at 50% 50%, transparent 55%, rgba(0, 0, 0, .55) 100%);
  animation: projector-flicker 5s steps(1) infinite;
}
@keyframes projector-flicker {
  0%, 100% { opacity: 1; }
  23% { opacity: .9; }
  24% { opacity: 1; }
  61% { opacity: .94; }
  62% { opacity: 1; }
}

/* grana della pellicola: rumore che "vibra" */
.deco-grain {
  position: absolute;
  inset: -50%;
  opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  animation: grain .9s steps(5) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-4%, 3%); }
  40%  { transform: translate(3%, -5%); }
  60%  { transform: translate(-2%, 6%); }
  80%  { transform: translate(5%, 2%); }
  100% { transform: translate(0, 0); }
}

/* strisce di pellicola con le perforazioni, che scorrono piano */
.deco-strip {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 26px;
  background-color: #070707;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='34'%3E%3Crect x='7' y='8' width='12' height='18' rx='3' fill='%23fff' fill-opacity='.11'/%3E%3C/svg%3E");
  background-size: 26px 34px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .04), 0 0 30px rgba(0, 0, 0, .8);
  opacity: .85;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
  animation: film-run 18s linear infinite;
}
.deco-strip--l { left: 0; }
.deco-strip--r { right: 0; animation-direction: reverse; }
@keyframes film-run { to { background-position: 0 340px; } }

/* ---------------- SERIE TV: schermo ---------------- */

.deco-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(91, 108, 255, .16), transparent 72%),
    radial-gradient(ellipse 110% 85% at 50% 50%, transparent 55%, rgba(0, 0, 0, .6) 100%);
}

/* righe orizzontali del vecchio televisore */
.deco-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(170, 185, 255, .035) 0 1px, transparent 1px 3px);
}

/* banda luminosa che scende lentamente, come il refresh di un CRT */
.deco-roll {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 35vh;
  background: linear-gradient(to bottom, transparent, rgba(140, 160, 255, .05), transparent);
  animation: crt-roll 10s linear infinite;
}
@keyframes crt-roll {
  from { transform: translateY(-40vh); }
  to   { transform: translateY(110vh); }
}

/* cornice arrotondata dello schermo */
.deco-frame {
  position: absolute;
  inset: 8px;
  border-radius: 28px;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(140, 160, 255, .07);
}

/* schermi stretti: niente pellicola ai lati (coprirebbe il contenuto) */
@media (max-width: 820px) {
  .deco-strip { display: none; }
  .deco-frame { inset: 4px; border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .deco * { animation: none !important; }
}

/* =========================================================
   PASSO 6 — griglia, Scopri, Top 10, Duello, saghe, persone
   ========================================================= */

/* ---------------- barra sotto l'header ---------------- */

.tb-spacer { flex: 1; }
.dd--filters, .save-status { margin-left: 0; }
.toolbar .btn--sm .ic { width: 16px; height: 16px; }
.btn-duel .ic, .btn-top .ic { color: var(--gold); }
.btn-discover .ic { color: #b9a6ff; }
.badge--soft { background: rgba(255, 255, 255, .16); }
.btn-discover .badge:not([hidden]) { background: var(--accent); }

.view-toggle { padding: 3px; }
.view-toggle .seg-btn { padding: 4px 8px; display: grid; place-items: center; }
.view-toggle .ic { width: 17px; height: 17px; }

@media (max-width: 1240px) {
  .toolbar .btn--sm > span:not(.badge) { display: none; }
  .toolbar .btn--sm { padding: 0 10px; }
}

/* ---------------- etichette nelle righe ---------------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
  vertical-align: 1px;
  white-space: nowrap;
}
.tag .ic { width: 12px; height: 12px; }
.tag--top  { background: rgba(245, 197, 24, .16); color: var(--gold); }
.tag--new  { background: rgba(48, 164, 108, .2); color: #5ed49b; }
.tag--soon { background: rgba(255, 159, 67, .16); color: #ffb26b; }
.tag--ep   { background: rgba(127, 168, 255, .15); color: #9db8ff; }

/* ---------------- vista a griglia ---------------- */

.row.is-card {
  right: auto;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, .035);
}
.row.is-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .9); }
.row.is-card.is-leaving { transform: scale(.95); }

.card-poster {
  flex: none;
  width: 100%;
  aspect-ratio: 2 / 3;
  padding: 0;
  border: 0;
  background: linear-gradient(160deg, #24242c, #131318);
  cursor: pointer;
  overflow: hidden;
  display: block;
}
.card-poster img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s var(--ease); }
.row.is-card:hover .card-poster img { transform: scale(1.04); }
.card-noimg {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  color: rgba(255, 255, 255, .35);
  font-size: .82rem;
  font-weight: 600;
  text-align: center;
}
.card-noimg .ic { width: 34px; height: 34px; stroke-width: 1.2; }

.card-tags {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  pointer-events: none;
}
.card-tags .tag { margin: 0; backdrop-filter: blur(6px); background-color: rgba(10, 10, 14, .72); }

.card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.row.is-card:hover .card-actions,
.row.is-card:focus-within .card-actions,
.row.is-card.is-editing .card-actions { opacity: 1; transform: none; }
.card-actions .act { width: 32px; height: 32px; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .9); }
.card-actions .act .ic { width: 15px; height: 15px; }
.card-actions .act--edit { background: rgba(20, 20, 26, .85); }
.card-actions .act--seen { background: rgba(20, 20, 26, .85); }

.card-info { padding: 10px 12px 0; flex: none; }
.card-info .row-name { font-size: .92rem; display: block; }
.card-info .row-meta { margin-top: 1px; }
.card-info .row-edit { height: 34px; font-size: .9rem; padding: 0 8px; }

.card-bottom {
  padding: 6px 12px 0;
  min-height: 30px;
  display: flex;
  align-items: center;
}
.card-bottom .star { width: 19px; height: 19px; }
.card-bottom .stars-wrap { gap: 6px; }
.card-bottom .stars-val { font-size: .78rem; }
.card-bottom .row-avail img { width: 24px; height: 24px; border-radius: 6px; }

/* ---------------- schedine titolo (saghe, Scopri, persone) ---------------- */

.tc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 16px 14px;
}
.tc-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 118px;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 10px;
}
.tc-row::-webkit-scrollbar { height: 8px; }
.tc-row::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); border-radius: 8px; }

.tc { position: relative; min-width: 0; }
.tc-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(160deg, #24242c, #131318);
  cursor: pointer;
  display: block;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.tc-poster:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -14px rgba(0, 0, 0, .9); border-color: rgba(255, 255, 255, .25); }
.tc-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tc-noimg { height: 100%; display: grid; place-items: center; color: rgba(255, 255, 255, .3); }
.tc-noimg .ic { width: 30px; height: 30px; stroke-width: 1.2; }
.tc.is-current .tc-poster { border-color: rgba(var(--accent-rgb), .9); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .5); }
.tc.is-visti .tc-poster img { filter: saturate(.85); }

.tc-badge {
  position: absolute;
  left: 6px;
  top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 700;
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.tc-badge .ic { width: 11px; height: 11px; stroke-width: 2.6; }
.tc-badge--seen { background: rgba(10, 30, 20, .8); color: #5ed49b; }
.tc-badge--todo { background: rgba(10, 10, 14, .8); color: #c9c9d6; }
.tc-badge--soon { background: rgba(40, 22, 6, .85); color: #ffb26b; }
.tc-note { position: absolute; right: 6px; bottom: 54px; padding: 2px 7px; border-radius: 6px; background: rgba(10, 10, 14, .8); font-size: .7rem; font-weight: 700; }

.tc-add {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 10, 14, .78);
  backdrop-filter: blur(6px);
  cursor: pointer;
  opacity: .85;
  transition: background .2s, transform .2s, opacity .2s;
}
.tc-add .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.tc-add:hover { background: var(--accent); opacity: 1; transform: scale(1.08); }

.tc-title {
  margin-top: 7px;
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tc-sub {
  margin-top: 2px;
  font-size: .74rem;
  color: var(--muted);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* barra di avanzamento */
.meter {
  height: 6px;
  min-width: 90px;
  flex: 0 1 160px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}
.meter span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width .4s var(--ease); }

/* ---------------- scheda: navigazione, persone, saga ---------------- */

.dt-overlay { z-index: 170; }          /* sopra Scopri e Top 10 */
.dt-nav {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 0;
  display: flex;
  padding: 0 14px;
}
.dt-nav .round-btn { margin-top: 14px; background: rgba(10, 10, 14, .65); backdrop-filter: blur(8px); }
.dt-nav .dt-back[hidden] { display: none; }
.dt-close { position: static; float: none; margin: 14px 0 0 auto; }

.btn--sm2 { height: 34px; padding: 0 12px; font-size: .85rem; border-radius: 10px; }
.btn--sm2 .ic { width: 15px; height: 15px; }
.dt-top .ic { color: var(--gold); }
.dt-top.is-on { background: rgba(245, 197, 24, .14); border-color: rgba(245, 197, 24, .45); color: var(--gold-soft); }

.dt-chip--soon { background: rgba(255, 159, 67, .14); border-color: rgba(255, 159, 67, .35); color: #ffc58f; }
.dt-chip--soon .ic { width: 13px; height: 13px; }

.dt-plink {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, .25);
  text-underline-offset: 3px;
}
.dt-plink:hover { text-decoration-color: var(--accent); color: #fff; }
button.dt-person { padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
button.dt-person:hover .dt-face { border-color: rgba(var(--accent-rgb), .9); transform: translateY(-2px); }
.dt-face { transition: border-color .2s, transform .2s; }

.dt-seasons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .07);
  width: fit-content;
}
.dt-seasons.has-new { border-color: rgba(48, 164, 108, .45); background: rgba(48, 164, 108, .08); }
.dt-new { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: #5ed49b; font-size: .88rem; }
.dt-new .ic { width: 15px; height: 15px; }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper b { font-size: 1.05rem; min-width: 1.2em; text-align: center; }
.round-btn--sm { width: 28px; height: 28px; font-size: 1rem; line-height: 1; }
.round-btn--sm .ic { width: 13px; height: 13px; }
.round-btn:disabled { opacity: .35; cursor: default; }

.dt-saga-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 14px;
  font-size: .92rem;
}
.dt-saga-head .ic { width: 15px; height: 15px; color: #5ed49b; vertical-align: -2px; margin-right: 4px; }

.dt-poster--person { border-radius: 50% / 38%; }
.dt-pfilters { margin-top: 6px; }
.dt-sec h3 small { margin-left: 6px; color: rgba(255, 255, 255, .4); font-weight: 600; }
.dt-more { margin-top: 14px; }
.dt-bio .dt-overview {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dt-bio.is-open .dt-overview { -webkit-line-clamp: unset; display: block; }
.dt-bio-more {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: 600 .85rem var(--font-body);
  cursor: pointer;
}
.dt--serie .dt-bio-more { color: #8f9bff; }

/* ---------------- Scopri ---------------- */

.md--wide .md-panel { width: min(1000px, 100%); }
.dc, .t10, .du { padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.dc-tabs { align-self: flex-start; }
.dc-tabs .tab .ic { width: 15px; height: 15px; }
.dc-tabs .tab.is-active { background: rgba(var(--accent-rgb), .25); color: #fff; }
.dc-body { min-height: 300px; display: flex; flex-direction: column; gap: 18px; }
.dc-body > .md-sub { margin: 0; }
.dc-progress {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}
.dc-note { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: .82rem; }
.dc-note .spinner { width: 12px; height: 12px; }
.dc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 50px 20px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}
.dc-empty p { margin: 0; }
.dc-sec h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.dc-sec h3 .ic { width: 15px; height: 15px; color: var(--accent); }
.dc-saga {
  padding: 14px 14px 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .07);
}
.dc-saga + .dc-saga { margin-top: 12px; }
.dc-saga-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 12px; }
.dc-saga-head b { font-size: 1rem; }
.dc-saga-count { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.dc-saga-head .btn { margin-left: auto; }
.dc-done { margin-top: 6px; }
.dc-done summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  list-style: none;
}
.dc-done summary::-webkit-details-marker { display: none; }
.dc-done summary .ic { width: 16px; height: 16px; color: #5ed49b; }
.dc-done[open] summary { color: var(--text); margin-bottom: 8px; }

/* ---------------- Scopri: barre filtri, saghe, in arrivo ---------------- */

.dc-pane { display: flex; flex-direction: column; gap: 16px; }
.dc-pane > .md-sub { margin: 0; }
.dc-out { display: flex; flex-direction: column; gap: 12px; }
.dc-out > .md-sub { margin: 0; }
.dc-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.dc-bar [hidden] { display: none !important; }
.dc-bar .chip { display: inline-flex; align-items: center; gap: 5px; }
.dc-bar .chip .ic { width: 13px; height: 13px; }
.dc-bar .btn .badge { margin-left: 2px; }
.dc-bar .btn.is-active { background: rgba(var(--accent-rgb), .2); border-color: rgba(var(--accent-rgb), .6); }
.dc-bar .btn:disabled { opacity: .55; cursor: progress; }
.dc-bar--tools { gap: 8px 10px; }
.dc-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--muted); font: inherit; font-size: .85rem; cursor: pointer;
}
.dc-link:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.dc-link .ic { width: 14px; height: 14px; }
.dc-genres {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .07);
}
.dc-genres[hidden] { display: none; }
.dc-search {
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 12px; flex: 1 1 200px; max-width: 280px;
  border-radius: 10px; border: 1px solid var(--border); background: rgba(255, 255, 255, .04);
  color: var(--muted);
}
.dc-search:focus-within { border-color: rgba(var(--accent-rgb), .7); }
.dc-search .ic { width: 15px; height: 15px; flex: none; }
.dc-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: .88rem; }
.dc-select {
  height: 34px; padding: 0 10px; margin-left: auto;
  border-radius: 10px; border: 1px solid var(--border);
  background: #1a1a21; color: var(--text); font: inherit; font-size: .85rem; cursor: pointer;
}
.dc-select:focus { outline: none; border-color: rgba(var(--accent-rgb), .7); }
.dc-flag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); color: #c9c9d6;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
}
.dc-flag .ic { width: 12px; height: 12px; }
.dc-flag--complete { background: rgba(10, 40, 25, .8); color: #5ed49b; }
.dc-flag--incomplete { background: rgba(var(--accent-rgb), .18); color: #fff; }
.dc-flag--soon { background: rgba(60, 32, 6, .8); color: #ffb26b; }
.dc-flag--new { background: rgba(70, 50, 120, .5); color: #d6c8ff; }
.dc-saga + .dc-saga { margin-top: 0; }
.dc-saga-head .meter { width: 90px; }
.dc-sec[hidden] { display: none; }
.dc-sec + .dc-sec { margin-top: 10px; }
.dc-more { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 14px; }
.dc-more:empty { display: none; }
.dc-nav .chip.is-selected, .dc-stati .chip.is-selected { box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .35); }
@media (max-width: 760px) {
  .dc-select { margin-left: 0; }
  .dc-search { max-width: none; }
  .dc-saga-head .btn { margin-left: 0; }
}

/* ---------------- Top 10 ---------------- */

.md-title .ic { width: .8em; height: .8em; color: var(--gold); vertical-align: -2px; }
.t10-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
.t10-slot {
  position: relative;
  border-radius: 14px;
  transition: transform .2s var(--ease), opacity .2s;
}
.t10-slot.is-empty {
  aspect-ratio: 2 / 3;
  display: grid;
  place-items: center;
  border: 1.5px dashed rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .3);
  font-size: .82rem;
}
.t10-slot.is-dragging { opacity: .35; }
.t10-slot.is-over { transform: scale(1.04); }
.t10-slot.is-over .t10-poster, .t10-slot.is-empty.is-over { outline: 2px solid var(--gold); outline-offset: 2px; }
.t10-n {
  position: absolute;
  left: -6px;
  top: -10px;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1;
  color: #fff;
  -webkit-text-stroke: 1px rgba(0, 0, 0, .5);
  text-shadow: 0 4px 14px rgba(0, 0, 0, .9);
  pointer-events: none;
}
.t10-slot:not(.is-empty):nth-child(-n+3) .t10-n { color: var(--gold); }
.t10-slot.is-empty .t10-n { position: static; font-size: 1.6rem; color: rgba(255, 255, 255, .2); -webkit-text-stroke: 0; text-shadow: none; }
.t10-slot.is-empty { grid-template-rows: auto auto; align-content: center; gap: 2px; }
.t10-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  overflow: hidden;
  background: #1d1d24;
  cursor: grab;
  display: block;
}
.t10-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t10-name {
  margin-top: 6px;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.t10-tools {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30px;
  display: flex;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transition: opacity .2s;
}
.t10-slot:hover .t10-tools, .t10-slot:focus-within .t10-tools { opacity: 1; }
.t10-tools .round-btn { background: rgba(10, 10, 14, .85); backdrop-filter: blur(6px); }
.t10-search { max-width: 460px; }
.t10-results { display: flex; flex-wrap: wrap; gap: 8px; }
.t10-res {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  padding: 4px 12px 4px 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .04);
  cursor: pointer;
  font-size: .84rem;
  text-align: left;
}
.t10-res:hover { background: rgba(245, 197, 24, .1); border-color: rgba(245, 197, 24, .4); }
.t10-res img, .t10-res-noimg { width: 26px; height: 39px; border-radius: 5px; object-fit: cover; flex: none; background: #26262e; }
.t10-res-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t10-res-v { color: var(--gold); font-weight: 700; font-size: .78rem; white-space: nowrap; }

/* ---------------- Duello ---------------- */

.md--duel .md-panel { width: min(820px, 100%); }
.du-stage { display: flex; flex-direction: column; gap: 14px; }
.du-stage > .md-sub { margin: 0; }
.du-sizes .chip { min-width: 54px; font-size: .95rem; padding: 7px 14px; }
.chip:disabled { opacity: .35; cursor: default; }
.du-go { align-self: flex-start; margin-top: 6px; }
.du-head { display: flex; align-items: baseline; justify-content: space-between; }
.du-round { font-family: var(--font-display); font-size: 1.7rem; letter-spacing: .04em; }
.du-count { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.du-arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
}
.du-vs {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--accent);
  text-shadow: 0 0 24px rgba(var(--accent-rgb), .7);
}
.du-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
  cursor: pointer;
  text-align: center;
  transition: transform .3s var(--ease), border-color .25s, background .25s, opacity .3s;
}
.du-card:hover { transform: translateY(-4px); border-color: rgba(var(--accent-rgb), .7); background: rgba(var(--accent-rgb), .08); }
.du-card.is-win { transform: scale(1.05); border-color: var(--gold); background: rgba(245, 197, 24, .1); }
.du-card.is-lose { opacity: .2; transform: scale(.94); }
.du-poster {
  width: min(220px, 100%);
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: #1d1d24;
  display: block;
  box-shadow: 0 20px 44px -20px rgba(0, 0, 0, .95);
}
.du-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.du-title { font-weight: 700; font-size: 1.02rem; line-height: 1.3; }
.du-meta { color: var(--muted); font-size: .82rem; }
.du-hint { margin: 0; text-align: center; color: rgba(255, 255, 255, .4); font-size: .8rem; }
.du-win { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding-bottom: 6px; }
.du-crown .ic { width: 38px; height: 38px; color: var(--gold); filter: drop-shadow(0 0 14px rgba(245, 197, 24, .6)); animation: pk-pop .6s var(--ease); }
.du-poster--win { width: 210px; box-shadow: 0 0 0 2px var(--gold), 0 30px 70px -18px rgba(245, 197, 24, .45); animation: pk-pop .5s var(--ease); }

@media (max-width: 760px) {
  .t10-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .du-arena { grid-template-columns: 1fr; }
  .dc, .t10, .du { padding: 20px 16px; }
}
.toolbar .btn[hidden] { display: none; }
.dt-poster--person { width: 170px; aspect-ratio: 1; border-radius: 50%; align-self: flex-start; margin-top: 30px; }

/* =========================================================
   AURORA — macchie di luce sfocate che si muovono lentamente
   dietro la pellicola (Film) e lo schermo TV (Serie)
   ========================================================= */

.deco-aurora { position: absolute; inset: 0; overflow: hidden; }

.au {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

/* Film: rosso, arancio e un tocco di cremisi */
.deco--film .au--1 { width: 46vw; height: 46vw; left: -12vw; top: -18vw; background: #e50914; opacity: .30; animation: au-a 28s ease-in-out infinite alternate; }
.deco--film .au--2 { width: 38vw; height: 38vw; right: -10vw; bottom: -16vw; background: #ff7a18; opacity: .20; animation: au-b 34s ease-in-out infinite alternate; }
.deco--film .au--3 { width: 30vw; height: 30vw; left: 38vw; top: 30vh; background: #b0103a; opacity: .14; animation: au-c 40s ease-in-out infinite alternate; }

/* Serie TV: blu, viola e un tocco di azzurro */
.deco--serie .au--1 { width: 46vw; height: 46vw; right: -12vw; top: -18vw; background: #3b82f6; opacity: .30; animation: au-a 30s ease-in-out infinite alternate-reverse; }
.deco--serie .au--2 { width: 40vw; height: 40vw; left: -12vw; bottom: -18vw; background: #8b5cf6; opacity: .26; animation: au-b 36s ease-in-out infinite alternate; }
.deco--serie .au--3 { width: 28vw; height: 28vw; left: 40vw; top: 28vh; background: #22b8e6; opacity: .12; animation: au-c 42s ease-in-out infinite alternate; }

@keyframes au-a {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(14vw, 10vh) scale(1.12); }
  100% { transform: translate(4vw, 22vh) scale(.95); }
}
@keyframes au-b {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-12vw, -12vh) scale(1.1); }
  100% { transform: translate(-22vw, -4vh) scale(1.05); }
}
@keyframes au-c {
  0%   { transform: translate(0, 0) scale(.9); }
  50%  { transform: translate(-18vw, 14vh) scale(1.15); }
  100% { transform: translate(16vw, -10vh) scale(1); }
}

/* la luce del proiettore e il bagliore TV si appoggiano sopra l'aurora */
.deco--film .deco-light { background:
    radial-gradient(ellipse 75% 55% at 50% -8%, rgba(229, 9, 20, .14), transparent 70%),
    radial-gradient(ellipse 120% 80% at 50% 50%, transparent 50%, rgba(0, 0, 0, .6) 100%); }
.deco--serie .deco-glow { background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(91, 108, 255, .10), transparent 72%),
    radial-gradient(ellipse 110% 85% at 50% 50%, transparent 50%, rgba(0, 0, 0, .62) 100%); }

/* voce di menu con spunta (Apri sempre a schermo intero) */
.dd-item--check .dd-tick {
  width: 18px; height: 18px; padding: 2px;
  border-radius: 5px;
  border: 1.5px solid rgba(255, 255, 255, .3);
  color: transparent;
}
.dd-item--check.is-checked .dd-tick { background: var(--accent); border-color: var(--accent); color: #fff; }
.du-skip { display: flex; align-items: center; gap: 8px; margin: -4px 0 0; color: #ffb26b; font-size: .85rem; }
.du-skip .ic { width: 15px; height: 15px; }

/* =========================================================
   OTTIMIZZAZIONI DI FLUIDITÀ
   ========================================================= */

/* --- caselle: posizionate con transform (impostato dal codice) --- */
.row {
  top: 0;
  left: 0;
  contain: layout style;
  transition: background .2s var(--ease), border-color .2s var(--ease), opacity .22s var(--ease), scale .26s var(--ease), translate .26s var(--ease);
}
.row[hidden] { display: none !important; }   /* anche sul telefono (dove la riga è una griglia) */
.row.is-leaving { scale: .97; }
.row.is-moving  { translate: 40px 0; }
.row.is-card:hover { translate: 0 -3px; box-shadow: none; border-color: rgba(255, 255, 255, .22); }
.row.is-card.is-leaving { scale: .95; }
.list-panel { contain: layout paint; }
.card-tags .tag { backdrop-filter: none; background-color: rgba(10, 10, 14, .85); }

/* --- stelle: due elementi con maschera ripetuta --- */
.stars {
  --star: 26px;
  width: calc(var(--star) * 5);
  height: var(--star);
  flex: none;
}
.stars-base, .stars-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  -webkit-mask-size: var(--star) var(--star);
          mask-size: var(--star) var(--star);
  -webkit-mask-repeat: repeat-x;
          mask-repeat: repeat-x;
}
.stars-base {
  width: 100%;
  background: rgba(255, 255, 255, .3);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8L12 16.9l-5.2 2.7 1-5.8-4.3-4.1 5.9-.9z' fill='none' stroke='black' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8L12 16.9l-5.2 2.7 1-5.8-4.3-4.1 5.9-.9z' fill='none' stroke='black' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.stars-fill {
  background: var(--gold);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8L12 16.9l-5.2 2.7 1-5.8-4.3-4.1 5.9-.9z' fill='black' stroke='black' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8L12 16.9l-5.2 2.7 1-5.8-4.3-4.1 5.9-.9z' fill='black' stroke='black' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.stars.is-preview .stars-fill { background: var(--gold-soft); }
.card-bottom .stars { --star: 19px; }
.dt-user .stars { --star: 28px; }
@media (max-width: 760px) { .stars { --star: 19px; } }

/* --- sfondo animato più leggero --- */
.deco { contain: strict; }
/* luci: sfumatura radiale invece del filtro di sfocatura (molto meno costosa) */
.au { filter: none; }
.deco--film .au--1  { width: 64vw; height: 64vw; left: -20vw; top: -26vw; background: radial-gradient(closest-side, rgb(229 9 20 / .85), rgb(229 9 20 / 0)); }
.deco--film .au--2  { width: 56vw; height: 56vw; right: -18vw; bottom: -24vw; background: radial-gradient(closest-side, rgb(255 122 24 / .85), rgb(255 122 24 / 0)); }
.deco--film .au--3  { width: 46vw; height: 46vw; left: 30vw; top: 22vh; background: radial-gradient(closest-side, rgb(176 16 58 / .85), rgb(176 16 58 / 0)); }
.deco--serie .au--1 { width: 64vw; height: 64vw; right: -20vw; top: -26vw; background: radial-gradient(closest-side, rgb(59 130 246 / .85), rgb(59 130 246 / 0)); }
.deco--serie .au--2 { width: 58vw; height: 58vw; left: -20vw; bottom: -26vw; background: radial-gradient(closest-side, rgb(139 92 246 / .85), rgb(139 92 246 / 0)); }
.deco--serie .au--3 { width: 44vw; height: 44vw; left: 32vw; top: 20vh; background: radial-gradient(closest-side, rgb(34 184 230 / .85), rgb(34 184 230 / 0)); }

/* grana fissa (prima vibrava su un livello enorme) */
.deco-grain { animation: none; inset: 0; }

/* pellicola: scorre con transform invece di ridisegnare lo sfondo */
.deco-strip { background: none; animation: none; overflow: hidden; }
.deco-strip i {
  position: absolute;
  left: 0;
  right: 0;
  top: -340px;
  bottom: 0;
  background-color: #070707;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='34'%3E%3Crect x='7' y='8' width='12' height='18' rx='3' fill='%23fff' fill-opacity='.11'/%3E%3C/svg%3E");
  background-size: 26px 34px;
  animation: film-run2 18s linear infinite;
  will-change: transform;
}
.deco-strip--r i { animation-direction: reverse; }
@keyframes film-run2 { to { transform: translateY(340px); } }

.deco-light { will-change: opacity; }
.deco-roll { will-change: transform; }

/* animazioni ferme quando una finestra copre la pagina (mentre scorri continuano) */
body.modal-open .deco *,
body.detail-open .deco * { animation-play-state: paused !important; }

/* header: niente sfocatura dello sfondo (costosa sopra uno sfondo animato) */
.topbar {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(22, 22, 28, .82);
}

/* griglia: angoli arrotondati direttamente sull'immagine (ritaglio molto più leggero) */
.row.is-card { overflow: visible; contain: layout style paint; }
.card-poster { overflow: visible; border-radius: 14px 14px 0 0; background: none; }
.card-poster img { border-radius: 14px 14px 0 0; transition: none; }
.row.is-card:hover .card-poster img { transform: none; }
.card-noimg { border-radius: 14px 14px 0 0; background: linear-gradient(160deg, #24242c, #131318); }

/* =========================================================
   BARRE DI SCORRIMENTO — stesso stile ovunque
   (finestre, menu, suggerimenti, filtri): niente fondo bianco
   né frecce, cursore arrotondato e staccato dagli angoli curvi.
   ========================================================= */
::-webkit-scrollbar { width: 12px; height: 12px; background: transparent; }
::-webkit-scrollbar-track { background: transparent; margin: 14px; }
::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, .16);
  border-radius: 12px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, .28); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }
.md-panel::-webkit-scrollbar-track { margin: 22px 0; }

/* ---------------- Filtri: persone, case, paesi, lingue ---------------- */
.chips--scroll { max-height: 150px; overflow-y: auto; padding-right: 2px; }
.fl-picked { display: flex; flex-wrap: wrap; gap: 6px; }
.fl-picked:not(:empty) { margin-bottom: 8px; }
.fl-pchip { display: inline-flex; align-items: center; gap: 6px; }
.fl-pchip .ic { width: 12px; height: 12px; stroke-width: 2.4; opacity: .8; }
.fl-ac { position: relative; }
.fl-ac-in { width: 100%; }
.fl-ac-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5;
  max-height: 260px; overflow-y: auto;
  padding: 4px; border-radius: 12px;
  background: #1c1c24; border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 18px 40px -10px rgba(0, 0, 0, .85);
}
.fl-ac-list[hidden] { display: none; }
.fl-ac-item {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  width: 100%; padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--text); font: inherit; font-size: .88rem; text-align: left; cursor: pointer;
}
.fl-ac-item:hover, .fl-ac-item.is-active { background: rgba(var(--accent-rgb), .2); }
.fl-ac-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-ac-meta { flex: none; color: var(--muted); font-size: .75rem; }
.fl-ac-none { padding: 10px; color: var(--muted); font-size: .82rem; }
.seg--persone[hidden] { display: none; }
.dt-mylist { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* controlli nativi (caselle, campi numerici, barre) in versione scura */
:root { color-scheme: dark; }
.fl-input[type="number"] { -moz-appearance: textfield; }
.fl-input[type="number"]::-webkit-inner-spin-button,
.fl-input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.fl-check input { color-scheme: dark; }

/* ---------------- Premi nella scheda ---------------- */
.dt-premi[hidden] { display: none; }
.dt-premi h3 .ic { width: 15px; height: 15px; color: var(--gold); vertical-align: -2px; margin-right: 6px; }
.pr-sum { margin-bottom: 10px; }
.pr-sum .ic { width: 13px; height: 13px; }
.pr-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 18px; }
.pr-list li { display: flex; align-items: baseline; gap: 8px; font-size: .9rem; color: var(--muted); line-height: 1.4; }
.pr-list li.is-won { color: var(--text); }
.pr-list li .ic { flex: none; width: 14px; height: 14px; color: var(--gold); transform: translateY(2px); }
.pr-list li small { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.pr-dot { flex: none; width: 6px; height: 6px; margin: 0 4px; border-radius: 50%; background: rgba(255, 255, 255, .3); transform: translateY(-2px); }
.pr-more { margin-top: 8px; }
.pr-more summary { cursor: pointer; color: var(--muted); font-size: .85rem; margin-bottom: 6px; }

/* ---------------- Scopri › Cerca ---------------- */
.sr { display: flex; flex-direction: column; gap: 16px; }
.sr [hidden] { display: none !important; }
.sr-name { display: flex; gap: 8px; flex-wrap: wrap; }
.sr-namefield { flex: 1 1 260px; max-width: none; height: 40px; }
.sr-name .btn { height: 40px; }
.sr-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.sr-sep::before, .sr-sep::after { content: ''; flex: 1; height: 1px; background: rgba(255, 255, 255, .08); }
.sr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .07);
}
.sr-f { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sr-f--wide { grid-column: 1 / -1; }
.sr-l {
  font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.sr-l small { text-transform: none; letter-spacing: 0; font-weight: 500; opacity: .8; }
.sr-l .ic { width: 13px; height: 13px; color: var(--gold); }
.sr-l--row { justify-content: space-between; }
.sr-l--inline { display: inline-flex; }
.sr-f .fl-row .fl-input { flex: 1; min-width: 0; }
.sr-f .dc-select { margin-left: 0; width: 100%; }
.sr-picked:empty { display: none; }
.sr-quick, .sr-reti { margin-top: 2px; }
.sr-quick .chip, .sr-reti .chip { font-size: .78rem; }
.sr-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sr-row .dc-select { width: auto; flex: 1 1 200px; }
.sr-hint { font-size: .78rem; color: var(--muted); }
.sr-generi { max-height: 120px; overflow-y: auto; }
.sr-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.sr-foot-opts, .sr-foot-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sr-foot .dc-select { margin-left: 0; }
.sr-out { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 16px; }
.sr-out:empty { display: none; }
.sr-head { margin: 0; }
.sr-ign { display: block; margin-top: 4px; color: #ffb26b; font-size: .82rem; }
.sr-picked .spinner { width: 11px; height: 11px; }
@media (max-width: 760px) {
  .sr-grid { grid-template-columns: 1fr; padding: 12px; }
  .sr-foot-act { width: 100%; justify-content: space-between; }
}
.sr-ac { width: 100%; }
@media (max-width: 760px) {
  .dc-tabs { align-self: stretch; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .dc-tabs .tab { flex-direction: column; justify-content: center; gap: 3px; padding: 7px 4px; font-size: .78rem; white-space: nowrap; min-width: 0; }
  .sr-name .btn { width: 100%; justify-content: center; }
}

/* ---------------- Trailer nella scheda ---------------- */
.dt-player { position: relative; margin: 24px 32px 0; }
@media (max-width: 760px) { .dt-player { margin: 18px 16px 0; } }
.dt-player-frame {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  border-radius: 16px; overflow: hidden; background: #000;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .9);
}
.dt-player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------------- Scopri: intestazione ferma, contenuto che scorre ---------------- */
.md--discover .md-panel { height: min(100%, 1100px); display: flex; flex-direction: column; overflow: hidden; }
.md--discover .md-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.md--discover .dc { position: relative; flex: 1 1 auto; min-height: 0; padding-bottom: 0; }
.md--discover .dc-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  position: relative;
  margin: 0 -28px;
  padding: 0 28px 28px;
}
.md--discover .dc-body::-webkit-scrollbar-track { margin: 4px 0 22px; }

/* barra dei filtri sempre visibile mentre si scende */
.dc-sticky {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 -28px;
  padding: 4px 28px 12px;
  background: #121217;
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.dc-sticky.is-stuck { border-bottom-color: rgba(255, 255, 255, .08); box-shadow: 0 14px 22px -16px rgba(0, 0, 0, .95); }
.dc-sticky .dc-genres .chips { max-height: 132px; overflow-y: auto; }

.dc-totop {
  position: absolute;
  right: 24px;
  bottom: 22px;
  z-index: 8;
  background: rgba(var(--accent-rgb), .85);
  border-color: transparent;
  box-shadow: 0 10px 26px -8px rgba(0, 0, 0, .9);
}
.dc-totop:hover { background: var(--accent); }
.dc-totop[hidden] { display: none; }
.dc-totop .ic { transform: rotate(-90deg); }
@media (max-width: 760px) {
  .md--discover .dc-body { margin: 0 -16px; padding: 0 16px 20px; }
  .dc-sticky { margin: 0 -16px; padding: 4px 16px 10px; }
  .dc-totop { right: 14px; bottom: 14px; }
}

/* Cerca: aggiornamento automatico dei risultati */
.sr-out { position: relative; }
.sr-out.is-loading > * { opacity: .45; pointer-events: none; transition: opacity .2s; }
.sr-out.is-loading::before {
  content: 'Aggiorno i risultati…';
  position: sticky; top: 70px; z-index: 3; align-self: center;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(var(--accent-rgb), .9); color: #fff; font-size: .82rem; font-weight: 600;
}
.sr-name .dc-search { flex: 1 1 100%; }

/* =========================================================
   SERIE TV — "Bagliore della TV al buio"
   Una stanza buia illuminata da uno schermo fuori campo (a sinistra):
   la luce blu cambia intensità come ai cambi di scena e, più lenta,
   vira un po' verso il viola o l'azzurro. Solo opacità animate
   (leggerissime), in pausa mentre scorri o con una finestra aperta.
   ========================================================= */
.deco--bagliore > div { position: absolute; inset: 0; }
.deco--bagliore .tvl-wall {
  background:
    radial-gradient(70% 90% at 0% 50%, rgba(120, 170, 255, .10), transparent 60%),
    linear-gradient(180deg, #07080e, #090b14 60%, #07080d);
}
.deco--bagliore .tvl-tv {
  background:
    radial-gradient(55% 75% at -6% 52%, rgba(90, 150, 255, .60), rgba(50, 90, 220, .22) 38%, transparent 68%),
    radial-gradient(35% 40% at 104% 12%, rgba(140, 100, 255, .16), transparent 70%);
  animation: tvl-cut 9s linear infinite;
  will-change: opacity;
}
/* seconda luce, più fredda o più calda: si mescola lentamente alla prima */
.deco--bagliore .tvl-tint {
  background: radial-gradient(48% 66% at -4% 46%, rgba(150, 110, 255, .38), rgba(90, 70, 220, .12) 40%, transparent 66%);
  opacity: 0;
  animation: tvl-tint 23s ease-in-out infinite;
  will-change: opacity;
}
.deco--bagliore .tvl-floor {
  top: auto;
  height: 38%;
  background: linear-gradient(to top, rgba(60, 110, 230, .18), transparent);
  animation: tvl-cut 9s linear infinite;
  will-change: opacity;
}
.deco--bagliore .tvl-vig { background: radial-gradient(ellipse 100% 90% at 45% 50%, transparent 40%, rgba(0, 0, 0, .7) 100%); }
.deco--bagliore .deco-scan { opacity: .5; }

/* "cambi di scena": la luce resta ferma e poi cambia in un attimo */
@keyframes tvl-cut {
  0%, 10%   { opacity: .86; }
  12%, 21%  { opacity: 1; }
  23%, 33%  { opacity: .72; }
  35%, 49%  { opacity: .95; }
  51%, 58%  { opacity: .8; }
  60%, 71%  { opacity: 1; }
  73%, 86%  { opacity: .74; }
  88%, 100% { opacity: .86; }
}
@keyframes tvl-tint {
  0%, 100% { opacity: 0; }
  30%      { opacity: .9; }
  55%      { opacity: .2; }
  75%      { opacity: .7; }
}

/* lettore: comandi nostri, niente suggerimenti di YouTube */
.dt-player-hit {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  border: 0; background: transparent; cursor: pointer;
  transition: background .25s;
}
.dt-player.is-ready:not(.is-playing) .dt-player-hit { background: rgba(6, 7, 12, .78); }   /* copre le proposte di YouTube in pausa */
.dt-player-big {
  width: 78px; height: 78px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(var(--accent-rgb), .92); color: #fff;
  box-shadow: 0 14px 40px -10px rgba(var(--accent-rgb), .8);
  opacity: 0; transform: scale(.9);
  transition: opacity .2s, transform .2s;
}
.dt-player-big .ic { width: 34px; height: 34px; margin-left: 4px; }
.dt-player.is-ready:not(.is-playing):not(.is-ended) .dt-player-big { opacity: 1; transform: none; }
.dt-player-msg {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 20px; text-align: center; color: var(--muted);
  pointer-events: none;
}
.dt-player-msg:empty { display: none; }
.dt-player-msg p { margin: 0; color: var(--text); max-width: 42ch; line-height: 1.5; }
.dt-player-msg .btn, .dt-player-endbtns { pointer-events: auto; }
.dt-player-msg .spinner { width: 22px; height: 22px; }
.dt-player.is-ended .dt-player-msg, .dt-player.is-error .dt-player-msg { background: #07080d; }  /* niente "altri video" alla fine */
.dt-player-endbtns { display: flex; gap: 10px; }

.dt-player-bar {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px; padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
}
.pl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  height: 36px; min-width: 36px; padding: 0 9px;
  border: 0; border-radius: 10px;
  background: transparent; color: var(--text);
  font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer;
  transition: background .15s;
}
.pl-btn:hover { background: rgba(255, 255, 255, .09); }
.pl-btn .ic { width: 18px; height: 18px; }
.pl-btn small { font-size: .72rem; color: var(--muted); }
.pl-btn--main { width: 42px; height: 42px; padding: 0; border-radius: 50%; background: rgba(var(--accent-rgb), .92); }
.pl-btn--main:hover { background: var(--accent); }
.pl-btn--main .ic { width: 20px; height: 20px; }
.pl-btn.is-off { color: var(--muted); }
.pl-btn--close { gap: 6px; padding: 0 12px; background: rgba(255, 255, 255, .06); }
.pl-time { min-width: 38px; text-align: center; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pl-seek {
  flex: 1; min-width: 60px; height: 6px; margin: 0 4px;
  -webkit-appearance: none; appearance: none;
  border-radius: 6px; cursor: pointer;
  background: linear-gradient(90deg, var(--accent) var(--p, 0%), rgba(255, 255, 255, .16) var(--p, 0%));
}
.pl-seek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .35);
}
.dt-player:fullscreen { display: flex; flex-direction: column; justify-content: center; margin: 0; padding: 18px; background: #000; }
.dt-player:fullscreen .dt-player-frame { flex: 1; aspect-ratio: auto; border-radius: 10px; }
@media (max-width: 600px) {
  .dt-player-bar { flex-wrap: wrap; }
  .pl-seek { order: -1; flex-basis: 100%; margin: 6px 4px 8px; }
  .pl-btn--close span { display: none; }
}

/* ---------------- Avvio con «Avvia Cineteca» / trasferimento ---------------- */
.md--mg .md-panel { width: min(600px, 100%); }
.mg { padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.mg .md-sub { max-width: none; margin: 0; }
.mg-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; line-height: 1.55; color: var(--text); }
.mg-steps code { font-size: .85em; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); }
.mg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.mg-status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.mg-status .spinner { width: 14px; height: 14px; }
.mg-status.is-ok { color: #5ed49b; }
.mg-status .ic { width: 16px; height: 16px; }
.mg-note { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }

/* =========================================================
   NUOVE SEZIONI: MUSICA (verde) e VIDEOGIOCHI (viola neon)
   ========================================================= */
.view--musica { --accent: #1ed760; --accent-rgb: 30, 215, 96; --accent-ink: #04140a;
  background: radial-gradient(ellipse 80% 55% at 50% -10%, rgba(30, 215, 96, .13), transparent 70%), #08100b; }
.view--giochi { --accent: #a855f7; --accent-rgb: 168, 85, 247;
  background: radial-gradient(ellipse 80% 55% at 50% -10%, rgba(168, 85, 247, .16), transparent 70%), #0a0710; }
.md--album, .md--artista, .md--musica, .dt--sez-musica { --accent: #1ed760; --accent-rgb: 30, 215, 96; }
.md--gioco, .md--giochi, .dt--sez-giochi { --accent: #a855f7; --accent-rgb: 168, 85, 247; }
.sub-view { position: absolute; inset: 0; }
.sub-view[hidden] { display: none; }
/* il verde è chiaro: testo scuro sui pulsanti pieni */
.view--musica .btn--primary, .md--musica .btn--primary, .md--album .btn--primary, .md--artista .btn--primary, .dt--sez-musica .btn--primary { color: #04140a; }
.view--musica .btn--primary .ic, .md--album .btn--primary .ic, .dt--sez-musica .btn--primary .ic { color: #04140a; }

/* --- pulsanti per andare alle altre sezioni (in alto a destra) --- */
.nav-sez { display: flex; gap: 6px; flex: none; }
.nav-sez-btn {
  height: 42px; min-width: 42px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .05);
  font-weight: 600; font-size: .85rem; cursor: pointer; color: var(--text);
  transition: background .2s, border-color .2s, box-shadow .2s, transform .15s;
}
.nav-sez-btn .ic { width: 18px; height: 18px; }
.nav-sez-btn span { display: none; }
.nav-sez-btn:hover span, .nav-sez-btn:focus-visible span { display: inline; }
.nav-sez-btn:active { transform: scale(.96); }
.nav-sez-btn--film .ic { color: #ff5a62; }
.nav-sez-btn--serie .ic { color: #8fa4ff; }
.nav-sez-btn--giochi .ic { color: #c99bff; }
.nav-sez-btn--musica .ic { color: #4ee88a; }
.nav-sez-btn--film:hover { background: rgba(229, 9, 20, .2); border-color: rgba(229, 9, 20, .6); }
.nav-sez-btn--serie:hover { background: rgba(91, 108, 255, .22); border-color: rgba(91, 108, 255, .6); }
.nav-sez-btn--giochi:hover { background: rgba(168, 85, 247, .22); border-color: rgba(168, 85, 247, .6); }
.nav-sez-btn--musica:hover { background: rgba(30, 215, 96, .18); border-color: rgba(30, 215, 96, .55); }
@media (max-width: 1100px) { .nav-sez-btn:hover span { display: none; } }

/* --- Album / Artisti --- */
.kind-switch { flex: none; }
.kind-switch .seg-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: .88rem; }
.kind-switch .seg-btn .ic { width: 15px; height: 15px; }

/* --- copertine quadrate (album) e tonde (artisti) --- */
.view--musica .card-poster { aspect-ratio: 1; }
.sub-view--artista .card-poster { border-radius: 50%; }
.sub-view--artista .row.is-card .card-poster img { border-radius: 50%; }
.tc--square .tc-poster { aspect-ratio: 1; border-radius: 10px; }
.tc--round .tc-poster { aspect-ratio: 1; border-radius: 50%; }
.tc--round .tc-badge { left: 50%; transform: translateX(-50%); }
.tc--round .tc-title, .tc--round .tc-sub { text-align: center; }
.tc-row--square { grid-auto-columns: 132px; }
.sg-item--square img, .sg-item--square .sg-noimg { width: 46px; height: 46px; }
.sg-item--round img, .sg-item--round .sg-noimg { width: 46px; height: 46px; border-radius: 50%; }
.dt-poster--square { aspect-ratio: 1; width: 220px; height: auto; align-self: flex-start; }
.dt-poster--round { aspect-ratio: 1; width: 200px; height: auto; align-self: flex-start; border-radius: 50%; }
.du-poster--square img, .du-poster--round img { aspect-ratio: 1; object-fit: cover; }
.du-poster--round img { border-radius: 50%; }
.md--album .pk-card, .md--artista .pk-card { aspect-ratio: 1; width: 240px; }
.md--artista .pk-card { border-radius: 50%; }

/* --- scheda: sfondo sfocato dalla copertina, artista, tracce --- */
.dt-hero--blur { position: relative; overflow: hidden; background: #0e1410; }
.dt-hero--blur::before {
  content: ''; position: absolute; inset: -40px;
  background: var(--backdrop) center / cover no-repeat;
  filter: blur(36px) saturate(1.3); opacity: .55;
}
.dt-hero--blur::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(18, 18, 23, .1), rgba(18, 18, 23, .6) 60%, #121217); }
.dt-artist { font-size: 1.15rem; margin-top: -4px; }
.dt-artist .dt-plink { font-weight: 700; }
.dt-chip--muted { color: var(--muted); }
.mz-tracks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.mz-track {
  display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 10px;
  transition: background .15s;
}
.mz-track:hover { background: rgba(255, 255, 255, .05); }
.mz-track.is-current { background: rgba(var(--accent-rgb), .12); }
.mz-play {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .05); color: var(--text); cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.mz-play .ic { width: 16px; height: 16px; }
.mz-play:hover:not(:disabled) { background: rgba(var(--accent-rgb), .25); border-color: rgba(var(--accent-rgb), .7); }
.mz-play.is-playing { background: var(--accent); border-color: var(--accent); color: #04140a; }
.mz-play:disabled { opacity: .35; cursor: default; }
.mz-pos { width: 22px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .85rem; }
.mz-tcover { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex: none; }
.mz-title { flex: 1; min-width: 0; line-height: 1.35; }
.mz-title small { color: var(--muted); }
.mz-feat { display: block; color: var(--muted); font-size: .8rem; }
.mz-e { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 3px; background: rgba(255, 255, 255, .2); font-size: .62rem; font-weight: 800; vertical-align: 1px; }
.mz-dur { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .85rem; }
.mz-disc { margin: 10px 0 4px; padding-left: 10px; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mz-disco-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 14px; }
.mz-disco-head h3 { margin: 0; }
.mz-disco-head .btn { margin-left: auto; }
.mz-disco-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

/* --- Scopri Musica --- */
.tc-grid--square { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.dc-search--wide { max-width: none; flex: 1 1 300px; }
.mz-genres { max-height: 84px; overflow-y: auto; }

/* =========================================================
   SFONDO MUSICA — vinile sul giradischi + onde sonore
   ========================================================= */
.deco--musica .au--1 { width: 64vw; height: 64vw; left: -22vw; top: -28vw; background: radial-gradient(closest-side, rgb(30 215 96 / .55), rgb(30 215 96 / 0)); }
.deco--musica .au--2 { width: 56vw; height: 56vw; right: -20vw; bottom: -26vw; background: radial-gradient(closest-side, rgb(16 140 90 / .6), rgb(16 140 90 / 0)); }
.deco--musica .au--3 { width: 40vw; height: 40vw; left: 34vw; top: 26vh; background: radial-gradient(closest-side, rgb(80 230 170 / .35), rgb(80 230 170 / 0)); }
.deco--musica .au { filter: none; opacity: .55; animation: au-a 34s ease-in-out infinite alternate; }
.deco--musica .au--2 { animation-name: au-b; animation-duration: 40s; }
.deco--musica .au--3 { animation-name: au-c; animation-duration: 46s; }

.mz-vinyl {
  position: absolute; width: min(78vh, 760px); aspect-ratio: 1; right: calc(min(78vh, 760px) * -0.42); top: 50%;
  transform: translateY(-50%); border-radius: 50%;
  background: #0d0d10;
  box-shadow: 0 0 0 10px #09090b, 0 30px 120px rgba(0, 0, 0, .8), 0 0 140px rgba(30, 215, 96, .18);
  opacity: .9;
}
.mz-vinyl i { position: absolute; border-radius: 50%; }
.mz-grooves { inset: 3%; background: repeating-radial-gradient(circle, #141417 0 2px, #1c1c21 2px 4px); }
.mz-label {
  inset: 34%;
  background: radial-gradient(circle, #0d0d10 0 9%, transparent 9.5%), radial-gradient(circle at 50% 50%, #1ed760, #11a34a);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .35);
  animation: mz-spin 6s linear infinite;
}
.mz-label b { position: absolute; left: 50%; top: 14%; width: 30%; height: 8%; margin-left: -15%; border-radius: 4px; background: rgba(4, 30, 15, .55); }
/* il riflesso resta fermo mentre il disco gira: così si vede che ruota */
.mz-shine { inset: 3%; background: conic-gradient(from 20deg, transparent 0 18%, rgba(255, 255, 255, .07) 23%, transparent 29% 68%, rgba(255, 255, 255, .05) 73%, transparent 79%); }
.mz-arm {
  position: absolute; right: 2vw; top: calc(50% - min(39vh, 380px) - 30px); width: 22px; height: min(46vh, 430px);
  border-radius: 12px; background: linear-gradient(90deg, #2a2a30, #3c3c44 50%, #222227); transform-origin: 50% 20px; transform: rotate(24deg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .7); opacity: .85;
}
.mz-arm i { position: absolute; left: 50%; top: -18px; width: 54px; height: 54px; margin-left: -27px; border-radius: 50%; background: radial-gradient(circle, #50505a, #26262c); }
.mz-arm::after { content: ''; position: absolute; left: -9px; bottom: -14px; width: 40px; height: 34px; border-radius: 6px; background: #2e2e35; }

.mz-waves { position: absolute; left: 0; right: 0; top: 50%; height: 40vh; transform: translateY(-50%); overflow: hidden; opacity: .8; }
.mz-waves svg { width: 200%; height: 100%; animation: mz-wave 26s linear infinite; filter: drop-shadow(0 0 6px rgba(30, 215, 96, .45)); }
.mz-vig { background: radial-gradient(ellipse 85% 80% at 45% 50%, transparent 45%, rgba(0, 0, 0, .65) 100%); position: absolute; inset: 0; }

@keyframes mz-spin { to { transform: rotate(360deg); } }
@keyframes mz-wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.mz-label, .mz-waves svg { will-change: transform; }
@media (max-width: 820px) { .mz-vinyl, .mz-arm { display: none; } }

/* --- Videogiochi in arrivo (fase 2) --- */
.deco--giochi-wip .au--1 { width: 64vw; height: 64vw; left: -20vw; top: -26vw; background: radial-gradient(closest-side, rgb(168 85 247 / .6), rgb(168 85 247 / 0)); }
.deco--giochi-wip .au--2 { width: 56vw; height: 56vw; right: -18vw; bottom: -24vw; background: radial-gradient(closest-side, rgb(90 40 200 / .6), rgb(90 40 200 / 0)); }
.deco--giochi-wip .au { filter: none; opacity: .5; }
.wip { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 40px 20px; color: var(--muted); }
.wip h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 4rem; color: #e9d5ff; letter-spacing: .04em; }
.wip p { margin: 0; max-width: 60ch; line-height: 1.6; }
.wip .ic--xl { width: 64px; height: 64px; color: #c99bff; stroke-width: 1.2; }
.wip-note { font-size: .85rem; }

/* elenco album: copertine quadrate con angoli morbidi invece del tondo */
.sub-view--album .row .poster, .sub-view--album .row .poster img { border-radius: 10px; }
@media (max-width: 760px) {
  .dt-poster--square, .dt-poster--round { width: 140px; }
}

/* =========================================================
   VIDEOGIOCHI — sfondo synthwave + HUD
   ========================================================= */
.deco--giochi { background: #09060f; }
.deco--giochi .au--1 { width: 64vw; height: 64vw; left: -24vw; top: -30vw; background: radial-gradient(closest-side, rgb(168 85 247 / .5), rgb(168 85 247 / 0)); }
.deco--giochi .au--2 { width: 56vw; height: 56vw; right: -20vw; bottom: -30vw; background: radial-gradient(closest-side, rgb(90 40 200 / .5), rgb(90 40 200 / 0)); }
.deco--giochi .au { opacity: .6; animation: au-a 36s ease-in-out infinite alternate; }
.deco--giochi .au--2 { animation-name: au-b; animation-duration: 42s; }

/* sole a righe sull'orizzonte */
.gs-sun {
  position: absolute; left: 50%; top: 47.5%; width: min(560px, 62vw); aspect-ratio: 1; margin-left: calc(min(560px, 62vw) / -2);
  transform: translateY(-62%); border-radius: 50%;
  background: linear-gradient(#ff7ad9, #a855f7 55%, #3b1d7a); opacity: .26;
  -webkit-mask: repeating-linear-gradient(to bottom, #000 0 22px, transparent 22px 30px);
          mask: repeating-linear-gradient(to bottom, #000 0 22px, transparent 22px 30px);
  animation: gs-sun 9s ease-in-out infinite alternate;
}
@keyframes gs-sun { to { opacity: .34; } }
.gs-hz { position: absolute; left: 0; right: 0; top: 47.5%; height: 2px; background: rgba(230, 160, 255, .6); box-shadow: 0 0 30px 6px rgba(168, 85, 247, .5); opacity: .7; }
/* pavimento a griglia in prospettiva: le righe scorrono verso di te */
.gs-floor { position: absolute; left: -50%; right: -50%; top: 47.5%; bottom: -12%; perspective: 520px; overflow: hidden;
  -webkit-mask: linear-gradient(transparent, #000 32%); mask: linear-gradient(transparent, #000 32%); }
.gs-floor i {
  position: absolute; left: 0; right: 0; top: 0; height: 200%;
  transform-origin: 50% 0; transform: rotateX(64deg);
  background:
    repeating-linear-gradient(90deg, rgba(190, 120, 255, .55) 0 2px, transparent 2px 80px),
    repeating-linear-gradient(0deg, rgba(190, 120, 255, .55) 0 2px, transparent 2px 80px);
  opacity: .5;
  animation: gs-run 3.2s linear infinite;
  will-change: transform;
}
@keyframes gs-run { from { transform: rotateX(64deg) translateY(-80px); } to { transform: rotateX(64deg) translateY(0); } }

/* HUD: angoli, barre dei progressi, radar */
.gs-br { position: absolute; width: 80px; height: 80px; border: 3px solid rgba(190, 130, 255, .4); }
.gs-br--tl { left: 22px; top: 22px; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.gs-br--tr { right: 22px; top: 22px; border-left: 0; border-bottom: 0; border-top-right-radius: 6px; }
.gs-br--bl { left: 22px; bottom: 22px; border-right: 0; border-top: 0; border-bottom-left-radius: 6px; }
.gs-bars { position: absolute; left: 34px; bottom: 120px; display: grid; gap: 10px; opacity: .75; pointer-events: auto; }
.gs-bar { display: grid; grid-template-columns: 70px 220px auto; align-items: center; gap: 10px; font: 700 .68rem/1 var(--font-body, sans-serif); letter-spacing: .16em; color: rgba(225, 200, 255, .8); }
.gs-track { position: relative; height: 12px; border-radius: 3px; border: 2px solid rgba(190, 130, 255, .5); }
.gs-track i { position: absolute; left: 2px; top: 2px; bottom: 2px; width: calc((100% - 4px) * var(--p, 0)); border-radius: 1px; transition: width .8s var(--ease); }
.gs-bar--hp .gs-track i { background: linear-gradient(90deg, #ec4899, #f472b6); box-shadow: 0 0 12px rgba(236, 72, 153, .6); }
.gs-bar--mp .gs-track i { background: linear-gradient(90deg, #22d3ee, #67e8f9); box-shadow: 0 0 12px rgba(34, 211, 238, .6); }
.gs-val { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.gs-map { position: absolute; right: 36px; bottom: 36px; width: 170px; height: 170px; border-radius: 50%; border: 3px solid rgba(190, 130, 255, .38); overflow: hidden;
  background: radial-gradient(circle, rgba(168, 85, 247, .22), transparent 70%), repeating-radial-gradient(circle, transparent 0 26px, rgba(190, 130, 255, .16) 26px 28px); }
.gs-sweep { position: absolute; inset: 0; background: conic-gradient(from 0deg, rgba(190, 130, 255, .35), transparent 22%); animation: gs-sweep 4s linear infinite; will-change: transform; }
.gs-dot { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px; background: #e9d5ff; clip-path: polygon(50% 0, 100% 100%, 50% 75%, 0 100%); }
@keyframes gs-sweep { to { transform: rotate(360deg); } }
.gs-vig { position: absolute; inset: 0; background: radial-gradient(ellipse 85% 80% at 50% 45%, transparent 50%, rgba(0, 0, 0, .6) 100%); }
@media (max-width: 820px) { .gs-bars, .gs-map, .gs-br { display: none; } }
@media (prefers-reduced-motion: reduce) { .gs-floor i, .gs-sweep, .gs-sun { animation: none; } }

/* schede: quattro invece di due */
.tabs--4 .tab { padding: 7px 11px; }
@media (max-width: 760px) {
  .tabs--4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .tabs--4 .tab { flex-direction: column; gap: 2px; padding: 6px 2px; font-size: .74rem; justify-content: center; white-space: nowrap; }
}

/* etichette nella lista */
.tag--cento { background: linear-gradient(90deg, rgba(245, 197, 24, .26), rgba(255, 220, 120, .18)); color: #ffd866; font-weight: 800; }
.tag--abbandonato { background: rgba(255, 255, 255, .08); color: #a9a9b6; }
.tag--plat { background: rgba(168, 85, 247, .16); color: #d6b4ff; }
.act--play { background: rgba(168, 85, 247, .2); color: #d0a6ff; }
.act--play:hover { background: #a855f7; color: #fff; }
.act--cart { background: rgba(255, 159, 67, .16); color: #ffb26b; }
.act--cart:hover { background: #f08a24; color: #fff; }

/* avviso "IGDB non collegato" cliccabile */
.link-status--btn { cursor: pointer; }
.link-status--btn u { text-underline-offset: 2px; }

/* --- scheda del gioco --- */
.gx-studio span { color: var(--muted); }
.gx-plats { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.gx-pl { padding: 3px 9px; border-radius: 6px; font-size: .75rem; font-weight: 700; letter-spacing: .02em; background: rgba(255, 255, 255, .07); color: #c9c9d4; border: 1px solid rgba(255, 255, 255, .08); }
.gx-pl.is-mine { background: rgba(168, 85, 247, .2); border-color: rgba(168, 85, 247, .55); color: #ead9ff; }
.gx-user { flex-direction: column; align-items: flex-start; gap: 10px; }
.gx-urow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.gx-urow .dt-user-label { min-width: 92px; }
.gx-lists { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.gx-move .seg-btn { padding: 6px 11px; }
.chip--cento.is-selected { background: rgba(245, 197, 24, .25); border-color: rgba(245, 197, 24, .7); color: #ffe08a; }
.chip.is-mine:not(.is-selected) { border-color: rgba(168, 85, 247, .5); }
.gx-dates { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.gx-dates span { white-space: nowrap; }
.gx-dates b { color: #d6b4ff; margin-right: 4px; }
.gx-ttb { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.gx-ttb div { padding: 14px 16px; border-radius: 14px; background: rgba(168, 85, 247, .1); border: 1px solid rgba(168, 85, 247, .25); display: grid; gap: 4px; }
.gx-ttb b { font-family: var(--font-display); font-weight: 400; font-size: 2rem; color: #ead9ff; letter-spacing: .02em; }
.gx-ttb span { color: var(--muted); font-size: .82rem; }
.dt-sec h3 .ic { width: 16px; height: 16px; margin-right: 6px; vertical-align: -2px; color: var(--accent); }
.gx-shops { display: flex; flex-wrap: wrap; gap: 8px; }
.gx-story summary { cursor: pointer; color: var(--accent); font-weight: 600; margin-top: 8px; }
.gx-videos, .gx-shots { display: grid; grid-auto-flow: column; grid-auto-columns: 240px; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.gx-video, .gx-shot { position: relative; border: 0; padding: 0; border-radius: 12px; overflow: hidden; cursor: pointer; background: #15121c; aspect-ratio: 16 / 9; }
.gx-video img, .gx-shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s var(--ease); }
.gx-video:hover img, .gx-shot:hover img { transform: scale(1.04); }
.gx-video span { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(transparent 40%, rgba(0, 0, 0, .7)); }
.gx-video span .ic { width: 38px; height: 38px; padding: 9px; border-radius: 50%; background: rgba(168, 85, 247, .85); color: #fff; }
.gx-video em { position: absolute; left: 10px; right: 10px; bottom: 8px; font-style: normal; font-size: .78rem; font-weight: 600; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.gx-serie-info { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 12px; color: var(--muted); }
.gx-serie-info b { color: var(--text); }
.gx-soon { color: #ffb26b; }

/* immagini a tutto schermo */
.gx-lb { position: fixed; inset: 0; z-index: 400; background: rgba(4, 3, 8, .94); display: grid; place-items: center; animation: gx-in .2s ease; }
.gx-lb img { max-width: 94vw; max-height: 88vh; border-radius: 10px; box-shadow: 0 30px 90px rgba(0, 0, 0, .8); }
.gx-lb .round-btn { position: absolute; }
.gx-lb-x { top: 18px; right: 18px; }
.gx-lb-prev { left: 18px; top: 50%; }
.gx-lb-next { right: 18px; top: 50%; }
.gx-lb-n { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, .7); font-size: .85rem; }
@keyframes gx-in { from { opacity: 0; } }

/* Scopri videogiochi */
.dc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.gx-mie { margin: 0; }
.gx-fbar .fl-input { width: 84px; }
.gx-flbl { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.gx-ord { width: auto; min-width: 150px; }

/* guida IGDB */
.gd-state { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; margin: 4px 0 14px; font-weight: 600; background: rgba(255, 139, 143, .1); color: #ffb0b3; }
.gd-state--ok { background: rgba(48, 164, 108, .14); color: #6ee0a6; }
.gd-state--file { background: rgba(168, 85, 247, .14); color: #e3c9ff; }
.gd-state .ic { width: 18px; height: 18px; flex: none; }
.gd-steps { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 12px; }
.gd-steps li { display: flex; gap: 12px; line-height: 1.55; }
.gd-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(168, 85, 247, .22); color: #ead9ff; font-weight: 800; }
.gd-steps pre { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, .35); font-size: .82rem; overflow-x: auto; }
.gd-steps code, .gd-steps pre { font-family: ui-monospace, Consolas, monospace; }
.gc-cons { margin: 6px 0 4px; }
/* la copertina non si allunga quando il riquadro accanto è più alto */
.dt-head .dt-poster { align-self: flex-start; }
.dc-head .fl-link, .dc-head .fl-check { margin: 0; align-self: center; }
/* Scopri videogiochi: piattaforme e generi su una riga che scorre di lato */
.md--giochi .dc-bar { flex-wrap: nowrap; }
.md--giochi .dc-bar:first-child { flex-wrap: wrap; }
.md--giochi .gx-pl, .md--giochi .gx-gen {
  flex: 1 1 0; min-width: 0; max-height: none; display: flex; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
  padding: 2px 2px 6px; border: 0; background: none; border-radius: 0;
}
.md--giochi .gx-pl .chip, .md--giochi .gx-gen .chip { flex: none; white-space: nowrap; }
.gx-fbar { flex-wrap: wrap !important; }
.gx-fbar .fl-input { flex: 0 0 88px; width: 88px; }
.gx-fbar .gx-flbl:not(:first-child) { margin-left: 14px; }

/* telefono: riga su due livelli (nome intero sopra, stelle o disponibilità sotto) */
@media (max-width: 760px) {
  .row:not(.is-card) {
    display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; grid-template-rows: auto auto;
    column-gap: 10px; row-gap: 5px; align-content: center; align-items: center;
  }
  .row:not(.is-card) > .poster { grid-column: 1; grid-row: 1 / 3; }
  .row:not(.is-card) > .row-main { grid-column: 2; grid-row: 1; }
  .row:not(.is-card) > .stars, .row:not(.is-card) > .row-avail { grid-column: 2; grid-row: 2; justify-self: start; }
  .row:not(.is-card) > .row-actions { grid-column: 3; grid-row: 1 / 3; }
  .row:not(.is-card) .row-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; }
  .row:not(.is-card) .row-meta { display: none; }
  .row:not(.is-card):not(:has(> .stars)) .row-meta { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .row:not(.is-card) .stars { --star: 17px; }
}

/* =========================================================
   MUSICA — mini lettore, disco con la copertina, "Ascoltalo su"
   ========================================================= */
.mp {
  position: fixed; right: 18px; bottom: 18px; z-index: 180;
  width: min(420px, calc(100vw - 24px)); display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 8px 8px; border-radius: 16px;
  background: rgba(14, 22, 17, .94); border: 1px solid rgba(30, 215, 96, .35);
  box-shadow: 0 22px 60px -18px rgba(0, 0, 0, .95), 0 0 0 1px rgba(0, 0, 0, .3);
  color: var(--text); animation: mp-in .3s var(--ease);
}
.mp[hidden] { display: none; }
@keyframes mp-in { from { opacity: 0; transform: translateY(16px); } }
.mp-cover { flex: none; width: 50px; height: 50px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: #1a2a20; cursor: pointer; }
.mp-cover:disabled { cursor: default; }
.mp-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp:not(.is-paused) .mp-cover img { animation: mp-pulse 2.4s ease-in-out infinite; }
@keyframes mp-pulse { 50% { transform: scale(1.06); } }
.mp-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.mp-t { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-a { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-bar { height: 4px; margin-top: 5px; border-radius: 4px; background: rgba(255, 255, 255, .12); cursor: pointer; position: relative; }
.mp-bar::before { content: ''; position: absolute; inset: -6px 0; }
.mp-bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: #1ed760; transition: width .25s linear; }
.mp-btn { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; background: transparent; color: var(--text); cursor: pointer; }
.mp-btn .ic { width: 17px; height: 17px; }
.mp-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.mp-btn:disabled { opacity: .3; cursor: default; }
.mp-btn--main { width: 40px; height: 40px; background: #1ed760; color: #04140a; }
.mp-btn--main:hover:not(:disabled) { background: #3be47a; }
.mp-x { width: 28px; height: 28px; color: var(--muted); }
/* i messaggi salgono sopra il mini lettore */
@media (max-width: 760px) { body.has-mp #toasts { bottom: 96px; } }
@media (max-width: 760px) { .mp { right: 12px; left: 12px; bottom: 12px; width: auto; } }

/* disco dello sfondo: mostra la copertina in ascolto e gira più veloce */
.mz-label.has-cover {
  background: radial-gradient(circle, #0d0d10 0 9%, transparent 9.5%), var(--cover) center / cover no-repeat;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .35), inset 0 0 40px rgba(0, 0, 0, .35);
}
.mz-label.has-cover b { display: none; }
.deco--musica.is-playing .mz-label { animation-duration: 1.8s; }
.mz-arm { transition: transform 1.2s var(--ease); }
.deco--musica.is-playing .mz-arm { transform: rotate(31deg); }

.mz-listen { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 14px; }
.mz-listen .dt-user-label { margin-right: 4px; }
.mz-svc { padding: 5px 11px; border-radius: 999px; font-size: .8rem; font-weight: 600; text-decoration: none; color: var(--text);
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); transition: background .15s, border-color .15s; }
.mz-svc::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: currentColor; }
.mz-svc--sp::before { background: #1ed760; }
.mz-svc--am::before { background: #fa2d48; }
.mz-svc--yt::before { background: #ff0033; }
.mz-svc--az::before { background: #25d1da; }
.mz-svc:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .22); }

/* statistiche (I tuoi numeri) */
.st-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 4px 0 18px; }
.st-card { padding: 14px 16px; border-radius: 14px; background: rgba(var(--accent-rgb), .1); border: 1px solid rgba(var(--accent-rgb), .25); display: grid; gap: 4px; }
.st-card b { font-family: var(--font-display); font-weight: 400; font-size: 2.1rem; letter-spacing: .02em; line-height: 1; }
.st-card span { color: var(--muted); font-size: .82rem; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 6px 28px; align-items: start; }
.st-bars { display: grid; gap: 8px; }
.st-row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 34px; align-items: center; gap: 10px; font-size: .85rem; }
.st-k { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #d8d8e0; }
.st-bar { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.st-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, rgba(var(--accent-rgb), .55), var(--accent)); }
.st-row b { text-align: right; font-variant-numeric: tabular-nums; }

/* offerte (IsThereAnyDeal) */
.tag--deal { background: rgba(48, 164, 108, .22); color: #6ee0a6; font-weight: 700; }
.tag--deal.is-low { background: linear-gradient(90deg, rgba(48, 164, 108, .35), rgba(245, 197, 24, .25)); color: #c6f5d9; }
.gx-deal { display: grid; gap: 8px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); }
.gx-deal.is-off { background: rgba(48, 164, 108, .08); border-color: rgba(48, 164, 108, .35); }
.gx-deal-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.gx-deal-main b { font-family: var(--font-display); font-weight: 400; font-size: 2rem; letter-spacing: .02em; }
.gx-deal-main s { color: var(--muted); }
.gx-cut { padding: 2px 8px; border-radius: 6px; background: #30a46c; color: #fff; font-weight: 800; font-size: .85rem; }
.gx-low { padding: 2px 8px; border-radius: 6px; background: rgba(245, 197, 24, .2); color: #ffd866; font-weight: 700; font-size: .8rem; }

/* =========================================================
   NOTIZIE — dall'ultima visita, uscite, articoli, offerte
   ========================================================= */
.md--serie { --accent: #6d7bff; --accent-rgb: 109, 123, 255; }
.nw-visit { margin-left: auto; color: var(--muted); font-size: .82rem; }
.nw-month h3 small, .dc-sec h3 small { color: var(--muted); font-weight: 600; margin-left: 4px; }
.nw-list { display: grid; gap: 12px; }
.nw-art { display: flex; gap: 14px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .06); }
.nw-art.is-mine { border-color: rgba(var(--accent-rgb), .45); background: rgba(var(--accent-rgb), .07); }
.nw-img { flex: none; width: 148px; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: #15151b; }
.nw-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nw-txt { min-width: 0; display: grid; gap: 4px; align-content: start; }
.nw-meta { font-size: .76rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.nw-meta b { color: #d8d8e0; }
.nw-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(var(--accent-rgb), .8); }
.nw-title { font-weight: 700; font-size: 1rem; line-height: 1.35; color: var(--text); text-decoration: none; }
.nw-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.nw-art:not(.is-new) .nw-title { color: #cfcfd8; }
.nw-sum { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nw-rel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.nw-rel > span { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.nw-hit { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; }
.nw-hit .ic { width: 13px; height: 13px; }
.chip.is-err { border-color: rgba(255, 139, 143, .5); color: #ffb0b3; }
.nw-src { margin: 10px 0 16px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1); display: grid; gap: 10px; }
.nw-src h4 { margin: 0; }
.nw-src ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.nw-src li { display: flex; align-items: center; gap: 10px; }
.nw-src li .fl-check { margin: 0; min-width: 170px; }
.nw-src li small { flex: 1; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nw-src-add { display: flex; flex-wrap: wrap; gap: 8px; }
.nw-src-add .fl-input { flex: 1 1 200px; }
.nw-src-foot { display: flex; justify-content: space-between; align-items: center; }
.nw-deal { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .03); margin-bottom: 8px; }
.nw-deal-cover { flex: none; width: 46px; height: 62px; border-radius: 8px; overflow: hidden; border: 0; padding: 0; background: #1b1724; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.nw-deal-cover img { width: 100%; height: 100%; object-fit: cover; }
.nw-deal-txt { flex: 1; min-width: 0; display: grid; gap: 4px; }
.nw-deal-txt s { color: var(--muted); }
/* riepilogo all'apertura */
.md--start .md-panel { max-width: 1100px; }
.nw-start .dc-body { overflow-y: auto; }
.nw-sez { padding: 6px 0 14px; border-bottom: 1px solid rgba(255, 255, 255, .07); margin-bottom: 10px; }
.nw-sez:last-child { border-bottom: 0; }
.nw-sez-head { display: flex; align-items: center; gap: 12px; }
.nw-sez-head h3 { margin: 6px 0; display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; letter-spacing: .04em; }
.nw-sez-head .fl-link { margin-left: auto; align-self: center; }
.nw-sez h4 { margin: 10px 0 8px; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.nw-sez--film h3 .ic { color: #ff5a62; } .nw-sez--serie h3 .ic { color: #8fa4ff; }
.nw-sez--giochi h3 .ic { color: #c99bff; } .nw-sez--musica h3 .ic { color: #4ee88a; }
.nw-start-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .07); }
.nw-start-foot .fl-check { margin: 0; }
.btn-news .badge { background: var(--accent); color: #fff; }
.view--musica .btn-news .badge { color: #04140a; }
@media (max-width: 760px) {
  .nw-img { width: 96px; }
  .nw-visit { width: 100%; margin: 0; }
  .btn-news span:not(.badge), .btn-discover span:not(.badge) { display: none; }
}
.dd-menu.dd-menu--left { right: auto; left: 0; transform-origin: top left; }
/* barra degli strumenti: su schermi medi "Top 10" resta solo icona, così tutto sta su una riga */
@media (max-width: 1560px) { .btn-top span { display: none; } .btn-top { padding-left: 10px; padding-right: 10px; } }
.md--start { --accent: #f5c518; --accent-rgb: 245, 197, 24; }
.md--start .btn--primary { color: #1a1400; }
.nw-sez h4 small { margin-left: 4px; color: var(--muted); }
.t-short { display: none; }
.md--notizie .dc-bar .fl-check { white-space: nowrap; margin: 0; }
@media (max-width: 760px) { .t-long { display: none; } .t-short { display: inline; } }
.st-curio { margin: 0; padding-left: 18px; display: grid; gap: 6px; line-height: 1.5; color: #d8d8e0; }
.st-note { margin: 10px 0 0; font-size: .85rem; line-height: 1.5; }
.st-card--ore b { min-width: 2ch; }

/* =========================================================
   TELEFONO E SINCRONIZZAZIONE
   ========================================================= */
.md--sync { --accent: #2fb6d9; --accent-rgb: 47, 182, 217; }
.cl .md-sub { margin-bottom: 14px; }
.cl-status .gd-state { margin: 0 0 16px; }
.cl-status .gd-state span { min-width: 0; }
.cl-status .spinner { flex: none; }
.cl-form { display: grid; gap: 8px; }
.cl-label { font-size: .8rem; font-weight: 600; color: var(--muted); margin-top: 4px; }
.field-btn { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin-right: -6px; border-radius: 8px; color: var(--muted); }
.field-btn:hover { color: var(--text); background: rgba(255, 255, 255, .08); }
.field-btn .ic { width: 18px; height: 18px; }
.cl-err { margin: 2px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(255, 139, 143, .1); color: #ffb0b3; font-size: .88rem; line-height: 1.45; }
.cl-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.cl-h { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; font-size: 1rem; }
.cl-h .ic { width: 18px; height: 18px; color: var(--accent); }
.cl-qrbox { display: flex; gap: 16px; align-items: flex-start; }
.cl-qrwrap { flex: none; width: 168px; padding: 8px; border-radius: 14px; background: #fff; }
.cl-qr { display: block; width: 100%; height: auto; }
.cl-qrtext p { margin: 0 0 10px; line-height: 1.5; font-size: .92rem; }
.cl-note { display: flex; gap: 6px; align-items: flex-start; font-size: .8rem !important; color: var(--muted); line-height: 1.45; margin: 14px 0 0; }
.cl-qrtext .cl-note { margin: 0 0 12px; }
.ic--in { width: 1em; height: 1em; vertical-align: -2px; flex: none; }
.cl-gen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 8px; }
.cl-pw { padding: 4px 8px; border-radius: 8px; background: rgba(0, 0, 0, .35); font-size: .82rem; user-select: all; word-break: break-all; }
.cl .gd-n { background: rgba(47, 182, 217, .2); color: #c9f1fb; }
.cl .gd-n .ic { width: 15px; height: 15px; }
@media (max-width: 520px) {
  .cl-qrbox { flex-direction: column; }
  .cl-qrwrap { width: min(220px, 70vw); align-self: center; }
}

/* pulsante nella home: stato della sincronizzazione */
.sync-btn {
  position: absolute;
  top: 18px;
  left: 22px;
  z-index: 4;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(10, 10, 14, .45);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .78);
  cursor: pointer;
  transition: background .2s, color .2s, transform .2s;
}
.sync-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; transform: scale(1.06); }
.sync-btn .ic { width: 19px; height: 19px; }
.sync-dot { position: absolute; right: 7px; bottom: 8px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid #121217; background: #6b7280; }
.sync-btn.is-ok .sync-dot { background: #34d399; }
.sync-btn.is-wait .sync-dot, .sync-btn.is-busy .sync-dot { background: #2fb6d9; animation: sync-pulse 1.2s ease-in-out infinite; }
.sync-btn.is-err .sync-dot { background: #f87171; }
.sync-btn.is-off .sync-dot { background: #fbbf24; }
@keyframes sync-pulse { 50% { opacity: .35; } }
.sync-banner {
  position: absolute;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 6;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(47, 182, 217, .55);
  background: rgba(10, 30, 40, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #e6f8fd;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 14px 40px -12px rgba(47, 182, 217, .6);
  cursor: pointer;
}
.sync-banner .ic { width: 18px; height: 18px; color: #7fdcf2; }
.sync-btn[hidden], .sync-banner[hidden] { display: none; }

/* =========================================================
   TELEFONO — la Cineteca come app
   barra delle sezioni in basso, intestazione compatta,
   spazi per la tacca e la barra di sistema (safe area)
   ========================================================= */
.tabbar { display: none; }
@media (max-width: 760px) {
  :root { --tabbar: calc(60px + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 140;
    display: flex;
    height: var(--tabbar);
    padding: 0 6px env(safe-area-inset-bottom);
    background: rgba(12, 12, 16, .9);
    border-top: 1px solid rgba(255, 255, 255, .08);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    transition: transform .35s var(--ease);
  }
  body[data-route="home"] .tabbar, body.modal-open .tabbar { transform: translateY(110%); }
  .tb-btn {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: rgba(255, 255, 255, .5);
    font-size: .68rem; font-weight: 600; letter-spacing: .02em;
    -webkit-tap-highlight-color: transparent;
  }
  .tb-btn .ic { width: 22px; height: 22px; transition: transform .2s var(--ease); }
  .tb-btn:active .ic { transform: scale(.88); }
  body[data-route="film"] .tb-btn--film { color: #ff5a62; }
  body[data-route="serie"] .tb-btn--serie { color: #93a6ff; }
  body[data-route="giochi"] .tb-btn--giochi { color: #cf9dff; }
  body[data-route="musica"] .tb-btn--musica { color: #5ff09a; }

  /* intestazione compatta: Home e sezioni passano nella barra in basso */
  .section-shell { padding: calc(10px + env(safe-area-inset-top)) 10px calc(var(--tabbar) + 8px); gap: 8px; }
  .topbar { gap: 8px; padding: 8px; border-radius: 16px; }
  .topbar .nav-btn--home, .topbar .nav-sez { display: none; }
  .topbar .field--add { flex: 1 1 calc(100% - 130px); order: 1; }
  .topbar .btn-add { order: 2; padding: 0 14px; }
  .topbar .field--search { flex: 1 1 calc(100% - 130px); order: 3; }
  .topbar .dd--sort { order: 4; }
  .topbar .dd--menu { order: 5; }
  .topbar .btn-sort .sort-label, .topbar .btn-sort .ic--sm { display: none; }
  .topbar .btn-sort { padding: 0 11px; }
  .topbar .kbd-hint { display: none; }
  .field { height: 44px; }
  .btn { height: 44px; }

  /* niente ingrandimento automatico di Safari quando si scrive */
  input, select, textarea { font-size: 16px !important; }

  /* finestre e schede sopra la tacca e la barra di sistema */
  .md-overlay, .dt-overlay { padding: calc(10px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom)); }
  #toasts { bottom: calc(var(--tabbar) + 14px); }
  body[data-route="home"] #toasts { bottom: calc(18px + env(safe-area-inset-bottom)); }
  body.has-mp #toasts { bottom: calc(var(--tabbar) + 90px); }
  .mp { bottom: calc(var(--tabbar) + 10px) !important; }
  body[data-route="home"] .mp { bottom: calc(12px + env(safe-area-inset-bottom)) !important; }

  /* home: tutto entra anche negli schermi bassi */
  .brand { top: calc(10px + env(safe-area-inset-top)); }
  .fs-btn, .sync-btn { top: calc(12px + env(safe-area-inset-top)); }
  .sync-btn { left: 12px; }
  .fs-btn { right: 12px; }
  .split--4 .side--film { flex-grow: 1.3; }
  .split--4 .side--film .side-content { padding-top: calc(58px + env(safe-area-inset-top)); }
  .split--4 .side--musica .side-content { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .split--4 .side-content { padding: 6px 1rem; }
  .sync-banner { bottom: calc(14px + env(safe-area-inset-bottom)); }
  body:has(.sync-banner:not([hidden])) .split--4 .side--musica .side-content { padding-bottom: 64px; }
}
@media (max-width: 760px) and (max-height: 760px) {
  .split--4 .side-emblem { display: none; }
  .split--4 .side-title { font-size: clamp(2rem, 9.5vw, 2.8rem); }
  .split--4 .side-btn { margin-top: .45rem; padding: .45rem 1.1rem; }
}
/* schermo intero: sul telefono non serve (e su iPhone non esiste) */
@media (pointer: coarse) { .fs-btn { display: none; } }
.is-app body, html.is-app { overscroll-behavior: none; }
@media (pointer: coarse) { [data-menu="fs"], [data-menu="fsauto"] { display: none !important; } }
/* iPad e schermi grandi installati come app: niente sotto la barra di stato */
@media (min-width: 761px) {
  .section-shell { padding-top: max(24px, calc(env(safe-area-inset-top) + 10px)); }
  .brand { top: max(26px, calc(env(safe-area-inset-top) + 8px)); }
}
.cl .pf-foot { flex-wrap: wrap; }
@media (max-width: 520px) { .cl .pf-foot .btn { flex: 1 1 auto; justify-content: center; } }
.field-btn { background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* --- gesti sulle righe (telefono) --- */
@media (pointer: coarse) {
  .row:not(.is-card) { touch-action: pan-y; }
}
.row.is-swiping { transition: none; background: #1a1a20; border-color: rgba(255, 255, 255, .12); z-index: 2; }
.swipe-bg {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: var(--row-h);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-weight: 700;
  font-size: .9rem;
  color: rgba(255, 255, 255, .85);
  pointer-events: none;
  transition: background .15s;
}
.swipe-bg[hidden] { display: none; }
.swipe-bg .ic { width: 22px; height: 22px; transition: transform .15s var(--ease); }
.swipe-bg span { display: inline-flex; align-items: center; gap: 8px; opacity: 0; transition: opacity .12s; }
.swipe-bg.is-right { background: rgba(48, 164, 108, .28); }
.swipe-bg.is-left { background: rgba(229, 72, 77, .28); }
.swipe-bg.is-right .swipe-go, .swipe-bg.is-left .swipe-del { opacity: 1; }
.swipe-bg.is-right.is-armed { background: #2f9e68; color: #fff; }
.swipe-bg.is-left.is-armed { background: #e5484d; color: #fff; }
.swipe-bg.is-armed .ic { transform: scale(1.18); }

/* --- condividi verso la Cineteca --- */
.sh .md-title { margin-bottom: 6px; }
.sh-src { display: flex; gap: 6px; align-items: flex-start; margin: 0 0 14px; color: var(--muted); font-size: .82rem; line-height: 1.4; overflow-wrap: anywhere; }
.sh .field { margin-bottom: 10px; }
.sh-types { margin-bottom: 10px; }
.sh-types .chip .ic { width: 15px; height: 15px; }
.sh-lists { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 12px; width: fit-content; max-width: 100%; }
.sh-label { font-size: .78rem; color: var(--muted); padding: 0 6px 0 8px; }
.sh-results { display: grid; gap: 8px; min-height: 80px; }
.sh-info { display: flex; align-items: center; gap: 10px; padding: 16px 4px; color: var(--muted); font-size: .9rem; }
.sh-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); }
.sh-row > img, .sh-noimg { flex: none; width: 44px; height: 64px; border-radius: 6px; object-fit: cover; background: rgba(255, 255, 255, .06); display: grid; place-items: center; }
.sh-row--sq > img, .sh-row--sq .sh-noimg { height: 44px; }
.sh-noimg .ic { width: 20px; height: 20px; color: var(--muted); }
.sh-text { flex: 1; min-width: 0; }
.sh-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-meta { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-dup { flex: none; font-size: .78rem; color: #6ee0a6; font-weight: 600; }
.sh-row .btn { flex: none; }

/* --- notifiche --- */
.cl-avvisi .sh-info { padding: 6px 0; }
.av-opts { display: grid; gap: 8px; margin-bottom: 12px; }
.av-opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); cursor: pointer; line-height: 1.4; font-size: .92rem; }
.av-opt input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: #2fb6d9; }
.av-opt.is-off { opacity: .55; }
.cl-avvisi .gd-state { margin: 0 0 10px; }
/* avvisi larghi sul telefono (non a colonnina stretta) */
@media (max-width: 760px) {
  #toasts { left: 12px; right: 12px; transform: none; }
  .toast { max-width: 100%; }
}

/* =========================================================
   BLOCCO CON IMPRONTA O PIN
   ========================================================= */
.lock { display: none; }
html.is-locked body > :not(.lock):not(.sprite) { opacity: 0 !important; pointer-events: none !important; }
html.is-locked .lock {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(91, 108, 255, .16), transparent 60%),
    radial-gradient(120% 70% at 50% 100%, rgba(229, 9, 20, .14), transparent 60%),
    #0a0a0e;
  color: #f3efe8;
}
.lock-box { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; width: min(340px, 100%); }
.lock-logo { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .9); }
.lock-name { font-family: var(--font-display); font-size: 2.4rem; letter-spacing: .3em; padding-left: .3em; line-height: 1; margin-top: 4px; }
.lock-msg { margin: 0 0 8px; color: rgba(243, 239, 232, .7); font-size: .95rem; line-height: 1.45; min-height: 2.9em; }
.lock-msg.is-err { color: #ffb0b3; }
.lock-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 56px; padding: 0 28px; border-radius: 999px;
  background: linear-gradient(135deg, #2fb6d9, #5b6cff); color: #fff;
  font: 700 1.05rem var(--font-body); border: 0; cursor: pointer;
  box-shadow: 0 16px 40px -14px rgba(47, 182, 217, .8);
  -webkit-tap-highlight-color: transparent;
}
.lock-btn .ic { width: 26px; height: 26px; }
.lock-btn:active { transform: scale(.97); }
.lock-btn:disabled { opacity: .6; }
.lock-btn--sm { height: 46px; padding: 0 20px; font-size: .95rem; }
.lock-alt { margin-top: 6px; background: none; border: 0; color: rgba(243, 239, 232, .55); font: 500 .85rem var(--font-body); text-decoration: underline; cursor: pointer; }
.lock-alt[hidden], .lock-pw[hidden] { display: none; }
.lock-pw { display: flex; gap: 8px; width: 100%; }
.lock-pw input {
  flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 12px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16); color: #fff; font: 500 16px var(--font-body);
}
.bl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.cl-blocco .gd-state { margin: 0 0 10px; }

/* =========================================================
   NAVIGAZIONE — selettore con cursore che scivola
   ========================================================= */
.sw, .dock { --blob: linear-gradient(135deg, #f3efe8, #cfc8bd); --blob-glow: rgba(243, 239, 232, .35); }
.sw[data-cur="film"],   .dock[data-cur="film"]   { --blob: linear-gradient(135deg, #e50914, #ff5a62); --blob-glow: rgba(229, 9, 20, .75); }
.sw[data-cur="serie"],  .dock[data-cur="serie"]  { --blob: linear-gradient(135deg, #4f5df0, #8b5cf6); --blob-glow: rgba(91, 108, 255, .75); }
.sw[data-cur="giochi"], .dock[data-cur="giochi"] { --blob: linear-gradient(135deg, #9333ea, #d946ef); --blob-glow: rgba(168, 85, 247, .75); }
.sw[data-cur="musica"], .dock[data-cur="musica"] { --blob: linear-gradient(135deg, #16a34a, #1ed760); --blob-glow: rgba(30, 215, 96, .6); }

.sw {
  position: relative;
  flex: none;
  display: inline-flex;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid rgba(255, 255, 255, .08);
}
.sw-blob {
  position: absolute;
  top: 4px; left: 4px;
  width: 46px; height: 32px;
  border-radius: 10px;
  background: var(--blob);
  box-shadow: 0 6px 18px -6px var(--blob-glow);
  transform: translateX(calc(var(--i, 0) * 46px));
  transition: transform .55s cubic-bezier(.3, 1.3, .5, 1);
}
.sw.no-anim .sw-blob { transition: none; }
.sw-btn, .tabbar .tb-btn {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}
.sw-btn {
  position: relative;
  z-index: 1;
  width: 46px; height: 32px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: rgba(255, 255, 255, .55);
  cursor: pointer;
  transition: color .25s, transform .15s;
}
.sw-btn .ic { width: 19px; height: 19px; }
.sw-btn:hover { color: #fff; }
.sw-btn:active { transform: scale(.92); }
.sw-btn.is-on { color: #fff; }
.sw[data-cur="home"] .sw-btn.is-on { color: #111; }

/* entrata delle sezioni nel verso in cui ti muovi */
html[data-dir="next"] .view--section.is-active .section-shell { animation: sez-da-destra .45s cubic-bezier(.2, .8, .2, 1) both; }
html[data-dir="prev"] .view--section.is-active .section-shell { animation: sez-da-sinistra .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes sez-da-destra { from { transform: translateX(34px); opacity: 0; } }
@keyframes sez-da-sinistra { from { transform: translateX(-34px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  html[data-dir] .view--section.is-active .section-shell { animation: none; }
  .sw-blob, .dock-blob { transition: none; }
}

/* telefono: barra flottante */
@media (max-width: 760px) {
  :root { --tabbar: calc(82px + env(safe-area-inset-bottom)); }
  .topbar .sw { display: none; }
  .tabbar.dock {
    left: 12px; right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    height: 62px;
    padding: 6px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(18, 18, 24, .78);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    box-shadow: 0 18px 44px -14px rgba(0, 0, 0, .9);
    transition: transform .45s cubic-bezier(.2, .8, .2, 1);
  }
  body[data-route="home"] .tabbar.dock, body.modal-open .tabbar.dock, body.dock-giu .tabbar.dock { transform: translateY(calc(100% + 30px + env(safe-area-inset-bottom))); }
  .dock-blob {
    position: absolute;
    top: 6px; bottom: 6px; left: 6px;
    width: calc((100% - 12px) / 5);
    border-radius: 16px;
    background: var(--blob);
    box-shadow: 0 10px 26px -10px var(--blob-glow);
    transform: translateX(calc(var(--i, 1) * 100%));
    transition: transform .5s cubic-bezier(.3, 1.3, .5, 1), box-shadow .3s;
  }
  .dock .tb-btn { position: relative; z-index: 1; gap: 2px; color: rgba(255, 255, 255, .5) !important; transition: color .25s; }
  .dock .tb-btn span { font-size: .62rem; letter-spacing: .03em; }
  .dock .tb-btn.is-on { color: #fff !important; }
  .dock .tb-btn.is-on .ic { transform: translateY(-1px) scale(1.1); }
  .dock .tb-btn .ic { transition: transform .35s cubic-bezier(.3, 1.4, .5, 1); }
}

/* copertina che non è arrivata: niente icona dell'immagine rotta, resta il riquadro */
img.img-ko { visibility: hidden; }
