/* =========================================================
   NeverEndingShelf — stile
   ========================================================= */

/* Fraunces (SIL Open Font License) servito dal sito stesso: nessuna richiesta a Google */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("../fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("../fonts/fraunces-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f4f0;
  --text: #1c1c1c;
  --muted: #6b6b6b;
  --line: #e3e1dc;
  --brand: #c0392b;
  --accent: #f6cf3f;
  --accent-hover: #f0c11c;
  --accent-text: #1c1c1c;
  --amazon: #ffa41c;
  --amazon-hover: #fa8900;
  --focus: #2563eb;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.08);
  --shadow-lg: 0 6px 14px rgba(0,0,0,.16), 0 18px 40px rgba(0,0,0,.14);
  --radius: 4px;
  --topbar-h: 60px;
  --gutter: 24px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --surface: #1c1c1c;
    --surface-2: #2a2a2a;
    --text: #f2f2f2;
    --muted: #b8b8b8;
    --line: #404040;
    --brand: #ff7a6b;
    --focus: #7aa7ff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.4);
    --shadow-lg: 0 8px 18px rgba(0,0,0,.6), 0 20px 44px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Barra superiore ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--topbar-h);
  padding: 10px var(--gutter);
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
.brand__mark { width: 28px; height: 28px; color: var(--text); }
.brand__name {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.brand__name em { font-style: normal; color: var(--brand); }

.search {
  position: relative;
  flex: 1 1 340px;
  max-width: 420px;
}
.search__icon {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: var(--muted);
  pointer-events: none;
}
.search__input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
.search__input::placeholder { color: var(--muted); }
.search__input:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent);
}

.count {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.lang button {
  border: 0;
  background: transparent;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted);
  cursor: pointer;
}
.lang button + button { border-left: 1px solid var(--line); }
.lang button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--muted); }

/* ---------- Pulsanti ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn__icon { width: 17px; height: 17px; fill: currentColor; flex-shrink: 0; display: inline-flex; }
.btn__icon svg { width: 100%; height: 100%; fill: currentColor; }

.btn--shuffle { background: var(--accent); color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 70%, #000); }
.btn--shuffle:hover { background: var(--accent-hover); }

.btn--amazon { background: var(--amazon); color: #111; border-color: #e88b00; }
.btn--amazon:hover { background: var(--amazon-hover); }

.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--muted); }

/* ---------- Intestazione contestuale (libro / autore) ---------- */

.hero {
  position: relative;
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin: 0 var(--gutter);
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  animation: rise .35s ease both;
}
.hero[hidden] { display: none; }

.hero--slim { padding: 16px 0; }

.hero__cover {
  flex: 0 0 auto;
  width: 128px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hero__cover img { display: block; width: 100%; height: 100%; object-fit: cover; }

.hero__avatar {
  position: relative;
  flex: 0 0 auto;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand), #8e2b20);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}
.hero__avatar span { font-family: var(--serif); font-size: 38px; font-weight: 600; }
.hero__avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }

.hero__body { flex: 1 1 auto; min-width: 0; max-width: 760px; }

.eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 4px;
}

.hero__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.hero__meta { margin: 6px 0 0; color: var(--muted); font-size: 16px; }
.hero__meta .dot { margin: 0 7px; }

.author-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--brand) 55%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color .15s, text-decoration-color .15s;
}
.author-link:hover { color: var(--brand); text-decoration-color: var(--brand); }

.hero__desc {
  margin: 12px 0 0;
  color: var(--text);
  opacity: .85;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero__desc.is-open { -webkit-line-clamp: unset; display: block; }

.more-toggle {
  border: 0;
  background: none;
  padding: 0;
  margin-top: 2px;
  color: var(--brand);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}
.chips:empty { display: none; }
.chips__label { color: var(--muted); font-size: 13px; margin-right: 2px; }
.chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 13px;
  text-decoration: none;
  transition: border-color .15s, background-color .15s;
}
.chip:hover { border-color: var(--muted); background: var(--surface); }

.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.hero__note { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

.hero__close {
  position: absolute;
  top: 18px;
  right: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
.hero__close:hover { background: var(--surface-2); color: var(--text); }

.author-match {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: border-color .15s;
}
.author-match:hover { border-color: var(--muted); }
.author-match__label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.author-match strong { font-family: var(--serif); font-size: 19px; }
.author-match__cta { color: var(--muted); font-size: 14px; }

.subject-head h1 { margin: 0; font-family: var(--serif); font-size: clamp(22px, 3vw, 30px); }

/* ---------- Muro di copertine ---------- */

.wall { padding: 22px var(--gutter) 40px; }

.collage { position: relative; width: 100%; }

.tile {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity .45s ease;
  will-change: transform;
}
.tile.is-in { opacity: 1; }
.no-anim .tile { transition: none; }

.tile-link {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  transform: translateY(8px) scale(.97);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease;
}
.tile.is-in .tile-link { transform: none; }

/* Riflesso "dorso del libro" sul lato sinistro */
.tile-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(0,0,0,.18) 0, rgba(255,255,255,.18) 2.5%, rgba(255,255,255,0) 6%, rgba(0,0,0,0) 100%);
  pointer-events: none;
}

.tile-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

@media (hover: hover) {
  .tile:hover { z-index: 5; }
  .tile.is-in:hover .tile-link { transform: translateY(-4px) scale(1.03); box-shadow: var(--shadow-lg); }
}
.tile.is-in .tile-link:focus-visible { transform: translateY(-4px) scale(1.03); box-shadow: var(--shadow-lg); }

.tile-amz {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 4px 6px;
  border-radius: 999px;
  background: var(--amazon);
  color: #111;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s, transform .18s, background-color .15s;
  pointer-events: none;
}
.tile-amz svg { width: 13px; height: 13px; fill: currentColor; }
.tile-amz:hover { background: var(--amazon-hover); }

@media (hover: hover) {
  .tile:hover .tile-amz { opacity: 1; transform: translateY(-4px); pointer-events: auto; }
}
@media (hover: none) {
  .tile-amz { display: none; }
}

/* ---------- Tooltip ---------- */

.tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  max-width: 280px;
  padding: 8px 11px;
  border-radius: 7px;
  background: rgba(20,20,20,.94);
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.tooltip.is-visible { opacity: 1; }
.tooltip strong { display: block; font-weight: 600; }
.tooltip span { display: block; color: rgba(255,255,255,.72); margin-top: 1px; }

/* ---------- Stato (caricamento, errori, fine) ---------- */

.status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
}
.status:empty { display: none; }
.status p { margin: 0; max-width: 460px; }
.status--empty { padding: 80px 16px; font-size: 16px; }

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}

#sentinel { height: 1px; }

/* ---------- Footer ---------- */

.foot {
  padding: 18px var(--gutter) 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.foot p { margin: 2px 0; }

/* ---------- Finestra "Info" ---------- */

.about {
  width: min(520px, calc(100vw - 32px));
  border: 0;
  border-radius: 12px;
  padding: 26px 26px 22px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.about::backdrop { background: rgba(0,0,0,.45); }
.about h2 { margin: 0 0 10px; font-family: var(--serif); font-size: 24px; }
.about p { margin: 0 0 12px; color: var(--text); opacity: .88; }
.about a { color: var(--brand); }
.about form { display: flex; justify-content: flex-end; margin-top: 6px; }

/* ---------- Animazioni ---------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tile { opacity: 1; }
  .tile-link { transform: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  :root { --gutter: 16px; }
  .count { display: none; }
}

@media (max-width: 680px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding-top: 8px; padding-bottom: 10px; }
  .brand__name { font-size: 22px; }
  .search { order: 3; flex: 1 1 100%; max-width: none; }
  #shuffle span { display: none; }
  #shuffle { width: 38px; padding: 0; }
  .wall { padding-top: 16px; }

  .hero { gap: 16px; padding: 18px 0; }
  .hero__meta { font-size: 15px; }
  .hero__actions .btn { flex: 1 1 auto; }
  .hero__close { top: 10px; }

  /* Copertina accanto al titolo, il resto sotto a tutta larghezza */
  .hero--book, .hero--author {
    display: grid;
    grid-template-columns: 72px 1fr;
    column-gap: 14px;
    row-gap: 0;
    align-items: start;
  }
  .hero--book .hero__body, .hero--author .hero__body { display: contents; }
  .hero__cover, .hero__avatar { grid-column: 1; grid-row: 1 / span 3; }
  .hero__cover { width: 72px; }
  .hero__avatar { width: 72px; height: 72px; }
  .hero__avatar span { font-size: 26px; }
  .hero .eyebrow, .hero__title, .hero__meta { grid-column: 2; padding-right: 30px; }
  .hero .eyebrow { margin-bottom: 0; align-self: end; }
  .hero__title { font-size: 22px; }
  .hero__meta { margin-top: 2px; }
  .hero__desc, .more-toggle, .chips, .hero__actions, .hero__note { grid-column: 1 / -1; }
  .more-toggle { justify-self: start; }
}


/* =========================================================
   Componenti aggiunti: generi, lista, suggerimenti, ecc.
   ========================================================= */

/* ---------- Ricerca: scorciatoia e suggerimenti ---------- */

.search__kbd {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: 600 12px/1.4 var(--font);
  color: var(--muted);
  background: var(--surface-2);
  pointer-events: none;
}
.search__input:focus ~ .search__kbd,
.search__input:not(:placeholder-shown) ~ .search__kbd { display: none; }
@media (hover: none) { .search__kbd { display: none; } }

.suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 70;
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: rise .16s ease both;
}
.suggest[hidden] { display: none; }
.sg__group {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sg__item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 10px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--text);
}
.sg__item:hover, .sg__item.is-active { background: var(--surface-2); }
.sg__thumb {
  width: 30px;
  height: 45px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 2px;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}
.sg__avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #8e2b20);
  color: #fff;
  font: 600 13px var(--serif);
}
.sg__text { display: flex; flex-direction: column; min-width: 0; }
.sg__text strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg__text small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg__all { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; color: var(--brand); font-weight: 600; }
.sg__all svg { width: 18px; height: 18px; fill: currentColor; margin: 0 6px; }

/* ---------- Pulsante "La mia lista" ---------- */

.icon-btn svg { width: 17px; height: 17px; fill: currentColor; }
.icon-btn--saved:hover, .icon-btn--saved.is-active { color: #e0245e; border-color: color-mix(in srgb, #e0245e 50%, var(--line)); }
.badge {
  position: absolute;
  top: -5px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e0245e;
  color: #fff;
  font: 700 11px/18px var(--font);
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}
.badge[hidden] { display: none; }
.badge.bump { animation: bump .35s ease; }

.btn--shuffle.spin .btn__icon { animation: spin-once .45s ease; }

/* ---------- Barra dei generi ---------- */

.genre-bar {
  position: relative;
  border-bottom: 1px solid var(--line);
}
.genre-bar[hidden] { display: none; }
.genre-bar__track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px var(--gutter);
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.genre-bar__track::-webkit-scrollbar { display: none; }
.genre-bar::before, .genre-bar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
  z-index: 1;
}
.genre-bar::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.genre-bar::after { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }
.genre-bar.fade-left::before, .genre-bar.fade-right::after { opacity: 1; }

.genre {
  --genre: var(--text);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, background-color .15s, color .15s, transform .15s;
}
.genre:hover { border-color: color-mix(in srgb, var(--genre) 55%, var(--line)); transform: translateY(-1px); }
.genre__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--genre); }
.genre.is-active {
  background: var(--genre);
  border-color: var(--genre);
  color: #fff;
}
.genre.is-active .genre__dot { background: #fff; }
.genre--all.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ---------- Intestazioni sottili (genere, tema, lista) ---------- */

.hero--slim {
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 24px;
}
.slim-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.1;
}
.hero--genre { --genre: var(--brand); }
.hero--genre .eyebrow { color: var(--g, var(--genre)); }
.hero--genre .slim-head { padding-left: 14px; border-left: 4px solid var(--genre); }

.btn--sm { height: 34px; padding: 0 13px; font-size: 13px; }
.btn--text { background: none; border-color: transparent; color: var(--muted); padding: 0 8px; }
.btn--text:hover { color: var(--text); }
.btn--icon { width: 38px; padding: 0; }
.btn--icon svg { width: 18px; height: 18px; fill: currentColor; }
.btn--save svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.btn--save[aria-pressed="true"] { color: #e0245e; border-color: color-mix(in srgb, #e0245e 45%, var(--line)); }
.btn--save[aria-pressed="true"] svg { fill: currentColor; }
.pop svg { animation: pop .35s ease; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
}
.tab svg { width: 15px; height: 15px; fill: currentColor; }
.tab:hover { color: var(--text); border-color: var(--muted); }
.tab.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }
.tab__n {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 16%, transparent);
  font-size: 12px;
  text-align: center;
}
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}
.link-btn:hover { color: var(--brand); }

/* ---------- Dati del libro: voto, pagine, lettura gratuita ---------- */

.facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}
.fact { display: inline-flex; align-items: center; gap: 6px; }
.fact + .fact::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line);
  margin-right: 12px;
}
.fact--rating strong { color: var(--text); font-weight: 700; }
.fact__sub { font-size: 13px; }
.stars { position: relative; display: inline-block; font-size: 15px; letter-spacing: 1px; line-height: 1; }
.stars__bg { color: var(--line); }
.stars__fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; white-space: nowrap; color: #f5a623; }
button.hero__cover {
  padding: 0;
  border: 0;
  cursor: zoom-in;
  transition: transform .2s ease, box-shadow .2s ease;
}
button.hero__cover:hover { transform: translateY(-2px) rotate(-1deg); }

/* ---------- Fascia "Altri libri di …" ---------- */

.band {
  margin: 0 var(--gutter);
  padding: 18px 0 16px;
  border-bottom: 1px solid var(--line);
  animation: rise .35s ease both;
}
.band[hidden] { display: none; }
.band__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.band__head h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--muted); }
.band__head h2 a { color: var(--text); text-decoration: none; font-family: var(--serif); font-size: 17px; }
.band__head h2 a:hover { color: var(--brand); }
.band__all { font-size: 13.5px; font-weight: 600; color: var(--brand); text-decoration: none; white-space: nowrap; }
.band__row {
  display: flex;
  gap: 14px;
  min-height: 176px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.mini {
  flex: 0 0 auto;
  width: 96px;
  scroll-snap-align: start;
  text-decoration: none;
  color: var(--text);
}
.mini img {
  display: block;
  width: 96px;
  height: 144px;
  object-fit: cover;
  border-radius: 3px;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.mini:hover img { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.mini span {
  display: -webkit-box;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Ordinamento ---------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 var(--gutter);
  padding: 14px 0 0;
}
.toolbar[hidden] { display: none; }
.toolbar__label { font-size: 13px; color: var(--muted); }
.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented__opt {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  color: var(--muted);
  transition: background-color .15s, color .15s;
}
.segmented__opt:hover { color: var(--text); }
.segmented__opt.is-active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---------- Cuore sulle copertine ---------- */

.tile-save {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: #444;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  cursor: pointer;
  opacity: 0;
  transform: scale(.8);
  transition: opacity .18s, transform .18s, color .15s;
  pointer-events: none;
}
.tile-save svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.tile-save:hover { color: #e0245e; }
.tile.is-saved .tile-save { opacity: 1; transform: none; color: #e0245e; pointer-events: auto; }
.tile.is-saved .tile-save svg { fill: currentColor; }
@media (hover: hover) {
  .tile:hover .tile-save { opacity: 1; transform: none; pointer-events: auto; }
}

/* ---------- Tooltip: voto e pagine ---------- */

.tooltip .tip-extra { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: rgba(255,255,255,.85); }
.tooltip .tip-extra i { font-style: normal; opacity: .5; }
.tooltip .tip-rating { display: inline-flex; align-items: center; gap: 3px; color: #ffcf5c; font-weight: 600; }
.tooltip .tip-rating svg { width: 13px; height: 13px; fill: currentColor; }

/* ---------- Notifica (toast) ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 90;
  padding: 10px 18px;
  border-radius: 999px;
  background: #1c1c1c;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity .2s, transform .25s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-color-scheme: dark) { .toast { background: #f1f1f1; color: #111; } }

/* ---------- Copertina ingrandita ---------- */

.zoom {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: 92vw;
  max-height: 92vh;
  overflow: visible;
  cursor: zoom-out;
}
.zoom::backdrop { background: rgba(10,10,10,.82); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.zoom img {
  display: block;
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: zoom-in .25s cubic-bezier(.2,.8,.2,1);
}

/* ---------- Scheletro di caricamento ---------- */

.status--skeleton { padding: 0; display: block; }
.skeleton {
  columns: 150px;
  column-gap: 14px;
}
.skeleton span {
  display: block;
  margin-bottom: 14px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface-2) 20%, color-mix(in srgb, var(--surface-2) 55%, var(--bg)) 40%, var(--surface-2) 60%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  break-inside: avoid;
}

kbd {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  font: 600 12px var(--font);
  background: var(--surface-2);
}

@keyframes bump { 50% { transform: scale(1.35); } }
@keyframes pop { 40% { transform: scale(1.35); } }
@keyframes spin-once { to { transform: rotate(180deg); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes zoom-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

/* ---------- Responsive dei nuovi componenti ---------- */

@media (max-width: 680px) {
  .genre-bar__track { padding-top: 10px; padding-bottom: 10px; }
  .hero--slim { gap: 12px; }
  .hero--slim .btn--sm { width: 100%; }
  .toolbar { padding-top: 12px; }
  .toolbar__label { display: none; }
  .band__row { min-height: 150px; gap: 12px; }
  .mini, .mini img { width: 80px; }
  .mini img { height: 120px; }
  .facts { gap: 6px 14px; font-size: 13.5px; }
  .fact + .fact::before { margin-right: 8px; }
  .facts, .band { grid-column: 1 / -1; }
  .hero--book .facts { grid-column: 1 / -1; }
  .hero__actions .btn--icon, .hero__actions .btn--text { flex: 0 0 auto; }
  .suggest { position: fixed; left: 12px; right: 12px; top: auto; margin-top: 6px; }
  .skeleton { columns: 3; column-gap: 10px; }
  .skeleton span { margin-bottom: 10px; }
}

@media (max-width: 420px) {
  .topbar { gap: 8px; }
  .actions { gap: 7px; }
  .brand__name { font-size: 20px; }
  .brand__mark { width: 24px; height: 24px; }
  #about-btn { display: none; }
  .lang button { padding: 6px 7px; }
}

.foot .link-btn { font-size: 12px; }

/* ---------- Fonte della descrizione ---------- */

.desc-foot {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 4px;
}
.desc-foot .more-toggle { margin-top: 0; }
.desc-src { font-size: 12px; color: var(--muted); }
.desc-src a { color: inherit; }
.desc-src a:hover { color: var(--brand); }
@media (max-width: 680px) { .desc-foot { grid-column: 1 / -1; } }

/* ---------- Sorprendimi ---------- */

.genre--surprise {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 35%, var(--surface)), var(--surface));
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
}
.genre--surprise svg { width: 16px; height: 16px; fill: currentColor; }
.genre--surprise.is-rolling svg { animation: roll .6s linear infinite; }
.genre-bar__sep { flex: 0 0 1px; align-self: stretch; margin: 4px 2px; background: var(--line); }
@keyframes roll { to { transform: rotate(360deg); } }

/* ---------- Libro del giorno ---------- */

.band--potd { padding: 22px 0; }
.potd {
  position: relative;
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 20px 56px 20px 20px;
  border-radius: 14px;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 60%),
    linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
}
.potd__cover {
  flex: 0 0 auto;
  width: 112px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: rotate(-2deg);
  transition: transform .25s ease;
}
.potd__cover:hover { transform: rotate(0) translateY(-3px); }
.potd__cover img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; background: var(--surface-2); }
.potd__body { min-width: 0; max-width: 760px; }
.potd__title { margin: 0; font-family: var(--serif); font-size: clamp(22px, 2.6vw, 28px); line-height: 1.15; }
.potd__title a { text-decoration: none; }
.potd__title a:hover { color: var(--brand); }
.potd__desc {
  margin: 10px 0 0;
  opacity: .85;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.potd .hero__actions { margin-top: 14px; }
.potd__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.potd__close:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Stati vuoti ---------- */

.empty-genres__label { margin-top: 10px !important; font-size: 14px; }
.empty-genres { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 620px; }

/* ---------- Tastiera: pulsanti delle copertine raggiungibili ---------- */

.tile:focus-within { z-index: 5; }
.tile:focus-within .tile-save,
.tile:focus-within .tile-amz { opacity: 1; transform: none; pointer-events: auto; }
@media (hover: none) { .tile:focus-within .tile-amz { display: none; } }

@media (max-width: 680px) {
  .potd { gap: 14px; padding: 14px 40px 14px 14px; align-items: flex-start; }
  .potd__cover { width: 80px; }
  .potd__desc { -webkit-line-clamp: 3; font-size: 14px; }
  .potd .hero__actions .btn { flex: 1 1 auto; }
  .potd .facts { margin-top: 6px; }
}
@media (max-width: 420px) {
  .potd .hero__actions { margin-left: -94px; }
}

/* ---------- Torna su ---------- */

.to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 80;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  animation: rise .2s ease both;
}
.to-top[hidden] { display: none; }
.to-top svg { width: 20px; height: 20px; fill: currentColor; }
.to-top:hover { background: var(--surface-2); }

.translate-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.translate-btn::before { content: "文A"; font-size: 11px; color: var(--brand); letter-spacing: -1px; }
.translate-btn:hover { border-color: var(--muted); }
.translate-btn:disabled { opacity: .6; cursor: progress; }

/* =========================================================
   Liste personalizzate
   ========================================================= */

/* Pulsante "+" lista sulle copertine (sotto il cuore) */
.tile-list {
  position: absolute;
  top: 42px;
  right: 6px;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: #333;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  cursor: pointer;
  opacity: 0;
  transform: scale(.8);
  transition: opacity .18s, transform .18s, color .15s;
  pointer-events: none;
}
.tile-list svg { width: 16px; height: 16px; fill: currentColor; }
.tile-list:hover { color: var(--brand); }
@media (hover: hover) {
  .tile:hover .tile-list { opacity: 1; transform: none; pointer-events: auto; }
}
.tile:focus-within .tile-list { opacity: 1; transform: none; pointer-events: auto; }
@media (hover: none) { .tile-list { display: none; } }

.btn--lists svg { width: 17px; height: 17px; fill: currentColor; }

/* Selettore */
.picker {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 95;
  width: 300px;
  max-height: min(70vh, 460px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  animation: rise .16s ease both;
  overflow: hidden;
}
.picker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 2px 16px;
  font-size: 15px;
}
.picker__close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.picker__close:hover { background: var(--surface-2); color: var(--text); }
.picker__book {
  padding: 0 16px 8px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid var(--line);
}
.picker__list { overflow-y: auto; padding: 6px; }
.picker__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.picker__item:hover { background: var(--surface-2); }
.picker__item input { position: absolute; opacity: 0; pointer-events: none; }
.picker__check {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-radius: 6px;
  display: grid;
  place-items: center;
  transition: background-color .15s, border-color .15s;
}
.picker__item input:checked + .picker__check { background: var(--text); border-color: var(--text); }
.picker__item input:checked + .picker__check::after {
  content: "";
  width: 5px;
  height: 10px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}
.picker__item input:focus-visible + .picker__check { outline: 2px solid var(--focus); outline-offset: 2px; }
.picker__name { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker__name svg { width: 14px; height: 14px; fill: #e0245e; flex: 0 0 auto; }
.picker__n { font-size: 12px; color: var(--muted); }
.picker__new {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}
.picker__new input, .tab-form input {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.picker__new input:focus, .tab-form input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }

/* Su telefono: pannello dal basso */
.picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 94;
  background: rgba(0,0,0,.4);
  animation: fade .2s ease both;
}
.picker--sheet {
  left: 0;
  right: 0;
  top: auto;
  bottom: 0;
  width: auto;
  max-height: 75vh;
  border-radius: 16px 16px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  animation: sheet-up .25s cubic-bezier(.2,.8,.2,1) both;
}
.picker--sheet .picker__head { padding-top: 16px; font-size: 16px; }
.picker--sheet .picker__item { padding: 12px 10px; font-size: 15px; }

/* Schede della pagina "La mia lista" */
.tab--new {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  border-style: dashed;
  cursor: pointer;
}
.tab--new:hover { color: var(--brand); border-color: var(--brand); }
.tab-form { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tab-form input { width: 220px; flex: 0 1 auto; }

.toolbar--list { flex-wrap: wrap; gap: 10px; }
.list-name { margin: 0 6px 0 0; font-family: var(--serif); font-size: 22px; }
.btn--danger { color: #c62828; }
.btn--danger:hover { color: #8e1b1b; }
@media (prefers-color-scheme: dark) { .btn--danger { color: #ff7b7b; } .btn--danger:hover { color: #ffaaaa; } }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }

@media (max-width: 680px) {
  .hero--saved .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .hero--saved .tabs::-webkit-scrollbar { display: none; }
  .hero--saved .tab { flex: 0 0 auto; }
  .tab-form input { width: 160px; }
  .hero__actions .btn--lists { flex: 0 0 auto; }
}


/* =========================================================
   Tema scuro: più contrasto dove serviva
   ========================================================= */

/* Colore "leggibile" dei generi: nel tema scuro i colori scuri (Thriller,
   Horror, Classici…) vengono schiariti, così pallini, etichette e chip si vedono */
.genre, .hero--genre { --g: var(--genre); }
@media (prefers-color-scheme: dark) {
  .genre, .hero--genre { --g: color-mix(in srgb, var(--genre) 55%, #ffffff); }
  .genre__dot { background: var(--g); }
  .genre:hover { border-color: var(--g); }
  .genre.is-active { background: var(--g); border-color: var(--g); color: #111; }
  .genre.is-active .genre__dot { background: #111; }
  .genre--all.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }
  .hero--genre .eyebrow { color: var(--g); }
  .hero--genre .slim-head { border-left-color: var(--g); }

  /* Bordi e testi secondari */
  .btn--ghost { border-color: #555; }
  .btn--ghost:hover { border-color: #888; }
  .icon-btn { border-color: #555; color: #d0d0d0; }
  .search__input { border-color: #4a4a4a; background: #1c1c1c; }
  .chip { background: #262626; border-color: #4a4a4a; }
  .tab { border-color: #4a4a4a; color: #d0d0d0; }
  .segmented { border-color: #4a4a4a; }
  .segmented__opt { color: #c8c8c8; }
  .segmented__opt.is-active { background: #3a3a3a; color: #fff; }
  .hero__note, .desc-src, .chips__label, .fact__sub, .toolbar__label { color: #b0b0b0; }
  .stars__bg { color: #555; }
  .lang { border-color: #4a4a4a; }
  .lang button { color: #c8c8c8; }
  .genre-bar, .topbar, .hero, .band, .foot { border-color: #333; }

  /* Le copertine si staccano dallo sfondo con un filo chiaro */
  .tile-link, .mini img, .hero__cover, .potd__cover { box-shadow: 0 0 0 1px rgba(255,255,255,.08), var(--shadow-sm); }
  .tooltip { background: rgba(250,250,250,.97); color: #111; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
  .tooltip span { color: #555; }
  .tooltip .tip-extra { color: #333; }
  .tooltip .tip-rating { color: #b7791f; }
  .picker { border-color: #4a4a4a; }
  .picker__check { border-color: #666; }
  .sg__item:hover, .sg__item.is-active { background: #303030; }
  .suggest { border-color: #4a4a4a; }
  .potd { border-color: #3a3a3a; }
  .to-top { border-color: #555; }
}

/* =========================================================
   Classifiche e liste condivise
   ========================================================= */

.btn > svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.slim-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.slim-sub { margin: 6px 0 0; color: var(--muted); max-width: 640px; }
.slim-actions .btn svg { width: 15px; height: 15px; }

.icon-btn--top:hover, .icon-btn--top.is-active { color: #b7791f; border-color: color-mix(in srgb, #f2c230 60%, var(--line)); }
.genre--top { font-weight: 600; }
.genre--top svg { width: 15px; height: 15px; fill: #b7791f; }
@media (prefers-color-scheme: dark) { .genre--top svg { fill: #f2c230; } .icon-btn--top:hover, .icon-btn--top.is-active { color: #f2c230; } }

.hero--rank .slim-head { padding-left: 14px; border-left: 4px solid var(--from); }
.hero--rank .eyebrow { color: var(--from); }
@media (prefers-color-scheme: dark) {
  .hero--rank .slim-head { border-left-color: color-mix(in srgb, var(--from) 55%, #fff); }
  .hero--rank .eyebrow { color: color-mix(in srgb, var(--from) 55%, #fff); }
}

.page { padding: 0 0 8px; }
.page[hidden] { display: none; }

/* Indice delle classifiche */
.rk-section { margin-bottom: 34px; }
.rk-section h2 { margin: 0 0 14px; font-family: var(--serif); font-size: 22px; }
.rk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.rk-grid--big { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.rk-card {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 176px;
  padding: 16px;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, var(--from), color-mix(in srgb, var(--to) 80%, #000));
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.rk-card--big { min-height: 214px; }
.rk-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.rk-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.6) 0%, rgba(0,0,0,.25) 45%, rgba(0,0,0,0) 70%);
  z-index: 1;
}
.rk-card__text { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 2px; width: 100%; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.rk-card__kicker { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
.rk-card__text strong { font-family: var(--serif); font-size: 20px; line-height: 1.15; }
.rk-card--big .rk-card__text strong { font-size: 23px; }
.rk-card__text span:last-child { font-size: 13px; opacity: .92; }
.rk-card__covers {
  position: absolute;
  right: 16px;
  top: 14px;
  height: 50%;
  width: 62%;
  z-index: 0;
}
.rk-card__covers img {
  position: absolute;
  top: 0;
  right: calc(var(--i) * 19%);
  height: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 6px 16px rgba(0,0,0,.4);
  transform: rotate(calc((var(--i) - 1) * 6deg)) translateY(calc(var(--i) * 4px));
  /* visibili di base: l'animazione (se attiva) parte da trasparente */
  animation: fade .4s ease both;
  animation-delay: calc(var(--i) * 90ms);
}
.rk-card__covers img:nth-child(1) { z-index: 3; }
.rk-card__covers img:nth-child(2) { z-index: 2; }
.rk-card__covers img:nth-child(3) { z-index: 1; }

/* Elenco della classifica */
.rank { list-style: none; margin: 0 auto; padding: 0; max-width: 980px; }
.rank__row {
  display: grid;
  grid-template-columns: 52px 64px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  border-radius: 10px;
  transition: background-color .15s;
}
.rank__row:hover { background: var(--surface-2); }
.rank__n {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.rank__row--podium .rank__n {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 20px;
  color: #3b2a00;
}
.rank__row--1 .rank__n { background: linear-gradient(135deg, #ffe082, #f2b01e); }
.rank__row--2 .rank__n { background: linear-gradient(135deg, #eceff1, #b0bec5); color: #263238; }
.rank__row--3 .rank__n { background: linear-gradient(135deg, #ffcc80, #c77c3a); color: #3e1f00; }
.rank__cover img {
  display: block;
  width: 64px;
  height: 96px;
  object-fit: cover;
  border-radius: 3px;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}
.rank__info { min-width: 0; }
.rank__title {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.rank__title:hover { color: var(--brand); }
.rank__meta { margin-top: 3px; color: var(--muted); font-size: 14px; }
.rank__meta .author-link { font-weight: 500; text-decoration-thickness: 1px; }
.rank__meta .dot, .rank__rating .dot { margin: 0 6px; }
.rank__rating { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 5px; font-size: 13px; color: var(--muted); }
.rank__rating strong { color: var(--text); }
.rank__rating .stars { font-size: 13px; }
.rank__actions { display: flex; align-items: center; gap: 8px; }
.rank__save {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.rank__save svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.rank__save:hover { color: #e0245e; }
.rank__save[aria-pressed="true"] { color: #e0245e; border-color: color-mix(in srgb, #e0245e 45%, var(--line)); }
.rank__save[aria-pressed="true"] svg { fill: currentColor; }
.rank__list {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.rank__list svg { width: 17px; height: 17px; fill: currentColor; }
.rank__list:hover, .rank__list[aria-expanded="true"] { color: var(--text); border-color: var(--muted); }
@media (prefers-color-scheme: dark) { .rank__save, .rank__list { border-color: #555; color: #c8c8c8; } }

@media (max-width: 680px) {
  .rk-grid, .rk-grid--big { grid-template-columns: 1fr; }
  .rk-card, .rk-card--big { min-height: 184px; }
  .rk-card__covers { height: 44%; }
  .rank__pages { display: none; }
  .slim-actions { width: 100%; }
  .rank__row { grid-template-columns: 34px 52px 1fr; gap: 10px; padding: 12px 4px; }
  .rank__n { font-size: 19px; }
  .rank__row--podium .rank__n { width: 32px; height: 32px; font-size: 15px; }
  .rank__cover img { width: 52px; height: 78px; }
  .rank__title { font-size: 16px; }
  .rank__actions { grid-column: 3; justify-content: flex-start; }
  .rank__actions .btn span { display: inline; }
}

/* ---------- Copertina sbagliata ---------- */

.hero__coverwrap { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cover-report {
  border: 0;
  background: none;
  padding: 2px 4px;
  font-size: 11.5px;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent);
  cursor: pointer;
}
.cover-report:hover { color: var(--brand); }
.hero__cover.is-missing { display: grid; place-items: center; padding: 10px; }
.cover-placeholder { font-family: var(--serif); font-size: 13px; line-height: 1.25; text-align: center; color: var(--muted); }
@media (max-width: 680px) {
  .hero--book .hero__coverwrap { grid-column: 1; grid-row: 1 / span 3; }
  .cover-report { font-size: 10.5px; }
}

/* =========================================================
   La mia lista: panoramica delle liste
   ========================================================= */

.tab svg { width: 15px; height: 15px; fill: currentColor; }
.lists-intro { margin: 0 0 18px; color: var(--muted); max-width: 620px; }

.lgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.lcard {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
a.lcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.lcard__art {
  position: relative;
  height: 170px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255,255,255,.22), transparent 55%),
    linear-gradient(135deg, var(--c1), var(--c2));
  overflow: hidden;
}
/* Copertine a ventaglio al centro dell'illustrazione */
.lcard__art img {
  position: absolute;
  bottom: -14px;
  left: 50%;
  height: 150px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
  transform-origin: 50% 100%;
  transform: translateX(calc(-50% + (var(--i) - (var(--n) - 1) / 2) * 42px)) rotate(calc((var(--i) - (var(--n) - 1) / 2) * 8deg));
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.lcard__art img:nth-child(2) { z-index: 2; }
.lcard__art img:nth-child(1) { z-index: 1; }
.lcard__art img:nth-child(3) { z-index: 1; }
a.lcard:hover .lcard__art img {
  transform: translateX(calc(-50% + (var(--i) - (var(--n) - 1) / 2) * 52px)) rotate(calc((var(--i) - (var(--n) - 1) / 2) * 11deg)) translateY(-6px);
}
.lcard__empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: rgba(255,255,255,.9);
  font-size: 13px;
  font-weight: 600;
}
.lcard__empty svg { width: 34px; height: 34px; fill: rgba(255,255,255,.85); }
.lcard__body { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px 16px; }
.lcard__body strong { font-family: var(--serif); font-size: 19px; line-height: 1.2; overflow-wrap: anywhere; }
.lcard__body span { font-size: 13px; color: var(--muted); }

/* Scheda "crea una nuova lista": stessa forma delle liste, con copertine "vuote" da riempire */
.lcard--new { padding: 0; font: inherit; text-align: left; cursor: pointer; }
.lcard--new:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.lcard__art--new { display: block; background: var(--surface-2); }
.lcard__art--new i {
  position: absolute;
  bottom: -14px;
  left: 50%;
  height: 150px;
  aspect-ratio: 2 / 3;
  border-radius: 3px;
  border: 1.5px dashed color-mix(in srgb, var(--muted) 55%, transparent);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  transform-origin: 50% 100%;
  transform: translateX(calc(-50% + (var(--i) - (var(--n) - 1) / 2) * 42px)) rotate(calc((var(--i) - (var(--n) - 1) / 2) * 8deg));
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.lcard__art--new i:nth-child(2) { z-index: 2; }
.lcard--new:hover .lcard__art--new i {
  transform: translateX(calc(-50% + (var(--i) - (var(--n) - 1) / 2) * 52px)) rotate(calc((var(--i) - (var(--n) - 1) / 2) * 11deg)) translateY(-6px);
}
.new-plus {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: var(--shadow-sm);
  transform: translate(-50%, -50%);
  transition: transform .2s ease, background-color .2s;
}
.new-plus svg { width: 26px; height: 26px; fill: currentColor; }
.lcard--new:hover .new-plus, .tlc--new:hover .new-plus { background: var(--accent-hover); transform: translate(-50%, -50%) scale(1.08); }
.lcard--new .lcard__body > span { max-width: 240px; }
.lcard--form {
  align-items: stretch;
  justify-content: center;
  gap: 6px;
  min-height: 240px;
  padding: 20px;
}
.lcard--form strong { font-family: var(--serif); font-size: 19px; }
.lcard--form { cursor: default; border-color: var(--focus); }
.lcard--form input {
  width: 100%;
  height: 38px;
  margin-top: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.lcard--form input:focus { outline: none; border-color: var(--focus); }
.lcard__formbtns { display: flex; gap: 6px; margin-top: 6px; }

.back-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  margin-right: 4px;
}
.back-link:hover { color: var(--brand); }

@media (max-width: 680px) {
  .lgrid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .lcard__art { height: 130px; }
  .lcard__art img { height: 112px; bottom: -10px; transform: translateX(calc(-50% + (var(--i) - (var(--n) - 1) / 2) * 34px)) rotate(calc((var(--i) - (var(--n) - 1) / 2) * 9deg)); }
  .lcard__body { padding: 10px 12px 12px; }
  .lcard__body strong { font-size: 16px; }
  .lcard__art--new i { height: 112px; bottom: -10px; transform: translateX(calc(-50% + (var(--i) - (var(--n) - 1) / 2) * 34px)) rotate(calc((var(--i) - (var(--n) - 1) / 2) * 9deg)); }
  .lcard--new .lcard__body > span { display: none; }
  .lcard--form { min-height: 190px; padding: 14px; }
  .toolbar--list .back-link { flex-basis: 100%; }
}
@media (prefers-color-scheme: dark) {
  .lcard { border-color: #3a3a3a; }
}

/* =========================================================
   Scaffale riordinabile (Salvati e liste)
   ========================================================= */

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.shelf-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--muted);
}
.shelf-hint::before {
  content: "↕";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--text);
}

.shelf {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 26px 18px;
}
.shelf__item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
.shelf__cover {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.shelf__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.18) 0, rgba(255,255,255,.16) 2.5%, rgba(255,255,255,0) 6%);
  pointer-events: none;
}
.shelf__cover img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
.shelf__nocover { display: grid; place-items: center; height: 100%; padding: 10px; text-align: center; font-family: var(--serif); font-size: 13px; color: var(--muted); }
@media (hover: hover) {
  .shelf__item:hover .shelf__cover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
}

.shelf__pos {
  position: absolute;
  top: -9px;
  left: -9px;
  z-index: 2;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font: 700 12px/1 var(--font);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.shelf__remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(20,20,20,.72);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background-color .15s;
}
.shelf__remove:hover { background: #c62828; }
.shelf__item:hover .shelf__remove, .shelf__remove:focus-visible { opacity: 1; }
@media (hover: none) { .shelf__remove { opacity: 1; width: 26px; height: 26px; font-size: 16px; } }

.shelf__meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding-right: 30px; }
.shelf__title {
  font-family: var(--serif);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shelf__title:hover { color: var(--brand); }
.shelf__author { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.shelf__handle {
  position: absolute;
  right: -4px;
  bottom: 0;
  width: 30px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: grab;
}
.shelf__handle svg { width: 18px; height: 18px; fill: currentColor; }
.shelf__handle:hover, .shelf__handle:focus-visible { color: var(--text); background: var(--surface-2); }

/* Durante il trascinamento */
.shelf__item.is-placeholder .shelf__cover {
  box-shadow: none;
  background: transparent;
  outline: 2px dashed color-mix(in srgb, var(--text) 35%, transparent);
  outline-offset: -2px;
}
.shelf__item.is-placeholder > * { opacity: 0; }
.shelf__item.is-placeholder .shelf__cover { opacity: 1; }
.shelf__item.is-placeholder .shelf__cover img { opacity: .15; }
.shelf__item.is-leaving { transition: opacity .18s, transform .18s; opacity: 0; transform: scale(.85); }

.shelf__ghost {
  position: fixed !important;
  top: 0;
  left: 0;
  z-index: 100;
  margin: 0;
  pointer-events: none;
  cursor: grabbing;
  list-style: none;
  will-change: transform;
}
.shelf__ghost .shelf__cover { box-shadow: 0 18px 40px rgba(0,0,0,.35), 0 4px 10px rgba(0,0,0,.2); }
.shelf__ghost .shelf__remove, .shelf__ghost .shelf__handle, .shelf__ghost .shelf__pos { display: none; }
body.is-shelf-dragging, body.is-shelf-dragging * { cursor: grabbing !important; }
body.is-shelf-dragging { user-select: none; -webkit-user-select: none; }

/* Menu "Ordina per" */
.sort-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: auto;
}
.sort-select svg {
  position: absolute;
  left: 10px;
  width: 15px;
  height: 15px;
  fill: var(--muted);
  pointer-events: none;
}
.sort-select select {
  height: 34px;
  padding: 0 30px 0 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23888' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 8px center / 16px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.sort-select select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-color-scheme: dark) { .sort-select select { border-color: #555; } }

/* Notifica con pulsante (Annulla) */
.toast { display: flex; align-items: center; gap: 14px; }
.toast.has-action { pointer-events: auto; padding-right: 8px; }
.toast__action {
  border: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.toast__action:hover { background: rgba(255,255,255,.28); }
@media (prefers-color-scheme: dark) {
  .toast__action { background: rgba(0,0,0,.08); }
  .toast__action:hover { background: rgba(0,0,0,.16); }
}

@media (max-width: 680px) {
  .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 12px; }
  .shelf__title { font-size: 13px; }
  .shelf__author { font-size: 11.5px; }
  .shelf__meta { padding-right: 0; }
  .shelf__handle { display: none; } /* su touch si trascina tenendo premuto */
  .shelf__pos { top: -7px; left: -7px; min-width: 22px; height: 22px; font-size: 11px; }
  .sort-select { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .shelf__item { transition: none !important; }
}

/* ---------- Foto autori nella ricerca ---------- */

.sg__avatar { position: relative; overflow: hidden; }
.sg__avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.author-match { align-items: center; gap: 14px; }
.author-match__photo {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), #8e2b20);
  color: #fff;
  font: 600 18px var(--serif);
}
.author-match__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.author-match__text { display: flex; flex-direction: column; gap: 1px; }

/* ---------- Backup ---------- */

.backup-btn { margin-left: auto; }
.backup-btn svg { width: 15px; height: 15px; }
.backup h3 { margin: 22px 0 4px; font-family: var(--serif); font-size: 18px; }
.backup__box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  background: var(--surface-2);
}
.backup__stats { font-size: 13.5px; color: var(--muted); }
.backup__hint { font-size: 13px; color: var(--muted); }
.backup__file { position: relative; cursor: pointer; }
.backup__file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.backup__file svg { width: 16px; height: 16px; fill: currentColor; }
.backup__preview { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.backup__preview p { margin: 0 0 10px; }
.backup__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.backup__error { color: #c62828; margin: 0 !important; }
.backup__close { margin-top: 14px; }
@media (prefers-color-scheme: dark) { .backup__error { color: #ff7b7b; } }
@media (max-width: 680px) { .backup-btn { margin-left: 0; } }

/* ---------- Consigliati per la lista ---------- */

.btn--recs {
  background: linear-gradient(135deg, color-mix(in srgb, #7c4dff 16%, var(--surface)), color-mix(in srgb, #e05780 14%, var(--surface)));
  border-color: color-mix(in srgb, #7c4dff 45%, var(--line));
  color: var(--text);
}
.btn--recs:hover { border-color: #7c4dff; }
.btn--recs svg { fill: #7c4dff; }
.btn--recs[aria-expanded="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn--recs[aria-expanded="true"] svg { fill: currentColor; }
@media (prefers-color-scheme: dark) { .btn--recs svg { fill: #b39dff; } .btn--recs { border-color: #6a55b8; } }

.recs {
  margin-top: 34px;
  padding: 22px;
  border-radius: 16px;
  background:
    radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, #7c4dff 12%, transparent), transparent 60%),
    radial-gradient(70% 100% at 0% 100%, color-mix(in srgb, #e05780 10%, transparent), transparent 60%),
    var(--surface-2);
  border: 1px solid var(--line);
  scroll-margin-top: 80px;
  animation: rise .3s ease both;
}
.recs[hidden] { display: none; }
.recs__head .eyebrow { display: inline-flex; align-items: center; gap: 6px; color: #7c4dff; }
.recs__head .eyebrow svg { width: 14px; height: 14px; fill: currentColor; }
@media (prefers-color-scheme: dark) { .recs__head .eyebrow { color: #b39dff; } }
.recs__head h2 { margin: 2px 0 4px; font-family: var(--serif); font-size: clamp(20px, 2.4vw, 26px); }
.recs__sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.recs__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 22px 16px;
}
.rec { display: flex; flex-direction: column; gap: 8px; }
.rec__cover {
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.rec__cover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.rec__cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rec__meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rec__title {
  font-family: var(--serif);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rec__title:hover { color: var(--brand); }
.rec__author { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec__rating { font-size: 12px; color: #b7791f; font-weight: 600; }
@media (prefers-color-scheme: dark) { .rec__rating { color: #f2c230; } }
.rec__actions { display: flex; gap: 6px; margin-top: auto; }
.rec__add { flex: 1 1 auto; padding: 0 8px; }
.rec__add:disabled { opacity: 1; cursor: default; color: #2e7d32; border-color: color-mix(in srgb, #2e7d32 45%, var(--line)); }
@media (prefers-color-scheme: dark) { .rec__add:disabled { color: #6fcf86; } }
.rec__amz { width: 34px; padding: 0; flex: 0 0 auto; }
.rec--skeleton span {
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface) 20%, color-mix(in srgb, var(--surface) 50%, var(--bg)) 40%, var(--surface) 60%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@media (max-width: 680px) {
  .recs { padding: 16px 12px; margin-left: calc(var(--gutter) * -0.5); margin-right: calc(var(--gutter) * -0.5); }
  .recs__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 10px; }
  .rec__amzfull > span:not(.btn__icon) { display: none; }
  .rec__title { font-size: 13px; }
  .rec__actions { flex-direction: column; }
  .rec__amz { width: 100%; }
}

/* ---------- Autori seguiti e novità ---------- */

.btn--follow svg { width: 16px; height: 16px; fill: currentColor; }
.btn--follow[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.icon-btn--saved.has-news::after {
  content: "";
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1e88e5;
  box-shadow: 0 0 0 2px var(--bg);
}
.tab__dot { width: 8px; height: 8px; border-radius: 50%; background: #1e88e5; display: inline-block; margin-left: -2px; }

.news-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(135deg, color-mix(in srgb, #1e88e5 14%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, #1e88e5 40%, var(--line));
  transition: border-color .15s, transform .15s;
}
.news-banner:hover { border-color: #1e88e5; transform: translateY(-1px); }
.news-banner__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #1e88e5; color: #fff; flex: 0 0 auto; animation: ring 2.4s ease 1; }
.news-banner__icon svg { width: 19px; height: 19px; fill: currentColor; }
.news-banner__text { display: flex; flex-direction: column; min-width: 0; }
.news-banner__text strong { font-family: var(--serif); font-size: 17px; }
.news-banner__text span { font-size: 13px; color: var(--muted); }
.news-banner__cta { margin-left: auto; font-weight: 700; color: #1e88e5; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .news-banner__cta { color: #64b5f6; } }
@keyframes ring { 0%, 60%, 100% { transform: rotate(0); } 10%, 30%, 50% { transform: rotate(-12deg); } 20%, 40% { transform: rotate(12deg); } }

.follow-section { margin-bottom: 36px; }
.follow-section h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-family: var(--serif); font-size: 22px; }
.follow-section h2 svg { width: 20px; height: 20px; fill: #1e88e5; }
.news-none { color: var(--muted); padding: 18px; border: 1px dashed var(--line); border-radius: 12px; }
.rec__cover { position: relative; }
.rec__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  padding: 3px 8px;
  border-radius: 999px;
  background: #1e88e5;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.rec__amzfull { width: 100%; }

.fauthors { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.fauthor { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.fauthor__photo {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), #8e2b20);
  color: #fff;
  font: 600 30px var(--serif);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease;
}
.fauthor__photo:hover { transform: scale(1.05); }
.fauthor__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.fauthor__name { font-family: var(--serif); font-weight: 600; text-decoration: none; }
.fauthor__name:hover { color: var(--brand); }
.fauthor__unfollow { font-size: 12.5px; }

@media (max-width: 680px) {
  .news-banner { gap: 10px; padding: 10px 12px; }
  .news-banner__text span { display: none; }
  .fauthors { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 8px; }
  .fauthor__photo { width: 72px; height: 72px; font-size: 22px; }
}

/* =========================================================
   Sezioni: Libri · Manga · Videogiochi
   ========================================================= */

/* ---------- Tasto accanto alla lingua e tendina ---------- */

.secnav { position: relative; }

/* Icone a linea (sezioni): sempre contorno, mai riempite */
.ico-line { fill: none !important; stroke: currentColor; }

.secbtn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 30px;
  padding: 0 4px 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.secbtn:hover { border-color: var(--muted); }
.secbtn[aria-expanded="true"] { border-color: var(--muted); background: var(--surface-2); }
.secbtn svg { display: block; }
.secbtn__icon svg { width: 18px; height: 18px; }
.secbtn > svg { width: 14px; height: 14px; color: var(--muted); transition: transform .2s ease; }
.secbtn[aria-expanded="true"] > svg { transform: rotate(180deg); }

.secmenu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 96;
  width: 292px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: rise .14s ease both;
}
.secmenu[hidden] { display: none; }
.secmenu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--text);
  outline: none;
}
.secmenu__item:hover, .secmenu__item:focus-visible { background: var(--surface-2); }
.secmenu__item:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.secmenu__icon { flex: 0 0 auto; color: var(--muted); }
.secmenu__icon svg { display: block; width: 24px; height: 24px; }
.secmenu__item.is-current .secmenu__icon { color: var(--brand); }
.secmenu__text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.secmenu__text strong { font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.secmenu__text small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.secmenu__check { flex: 0 0 auto; color: var(--text); }
.secmenu__check svg { display: block; width: 18px; height: 18px; }

@media (max-width: 680px) {
  .secmenu {
    position: fixed;
    top: auto;
    left: 10px;
    right: 10px;
    width: auto;
    margin-top: 10px;
  }
}

/* Il colore del marchio segue la sezione */
body[data-section="manga"] { --brand: #d6336c; }
body[data-section="games"] { --brand: #4c6ef5; }
@media (prefers-color-scheme: dark) {
  body[data-section="manga"] { --brand: #ff7aa8; }
  body[data-section="games"] { --brand: #8fa6ff; }
}

/* ---------- Barra dei generi: piattaforme ---------- */

.genre--platform { font-weight: 600; }
.genre--platform .genre__dot { border-radius: 2px; }

/* ---------- Scheda manga / gioco ---------- */

.hero__orig {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}
.hero--manga .hero__cover img, .hero--game .hero__cover img { background: var(--item-color, var(--surface-2)); }
.hero__src { white-space: nowrap; }

.fact--status {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text);
}
.fact + .fact--status::before { display: none; }
.fact--status { margin-left: 4px; }
.fact--releasing { background: color-mix(in srgb, #2f9e44 15%, transparent); color: #2b8a3e; }
.fact--finished { background: color-mix(in srgb, #1c7ed6 13%, transparent); color: #1864ab; }
.fact--hiatus, .fact--cancelled { background: color-mix(in srgb, #f59f00 16%, transparent); color: #b35c00; }
@media (prefers-color-scheme: dark) {
  .fact--releasing { color: #8ce99a; }
  .fact--finished { color: #a5d8ff; }
  .fact--hiatus, .fact--cancelled { color: #ffd43b; }
}

/* Bollino PEGI */
.pegi {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 3px;
  border-radius: 4px;
  background: #8a8a8a;
  color: #fff;
  font: 700 12px/1 var(--font);
}
.pegi--3, .pegi--7 { background: #5cb85c; }
.pegi--12, .pegi--16 { background: #f0a30a; }
.pegi--18 { background: #d9302c; }
.rank__rating .pegi { margin-left: 6px; }

.chip--plain { cursor: default; }
.chip--plain:hover { border-color: var(--line); background: var(--surface-2); }
.chip--series { font-weight: 600; }
.chip--series span {
  margin-left: 3px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

/* Pulsanti Amazon per piattaforma */
.buy-platforms {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.buy-platforms__label { font-size: 13px; color: var(--muted); margin-right: 2px; }
.btn--plat { height: 30px; padding: 0 12px; font-weight: 700; }

/* Manga: "Cerca il cofanetto" */
.btn--amzalt { border-color: color-mix(in srgb, var(--amazon) 70%, var(--line)); }
.btn--amzalt:hover { background: color-mix(in srgb, var(--amazon) 12%, transparent); }

/* Avatar di studio e serie (senza foto) */
.hero__avatar--game, .author-match__photo--game, .sg__avatar--game {
  background: linear-gradient(135deg, #4f46e5, #22b8cf);
}
.hero__avatar--game span svg { width: 52px; height: 52px; }
.hero__avatar--game span svg:not(.ico-line) { fill: currentColor; }
.author-match__photo--game svg { width: 26px; height: 26px; color: #fff; }
.sg__avatar--game svg { width: 18px; height: 18px; color: #fff; }
.hero--manga .hero__avatar, .hero--manga .author-match__photo { background: linear-gradient(135deg, #e0245e, #ff8a5c); }
.hero--manga .hero__avatar img { object-position: center 15%; }
body[data-section="manga"] .sg__avatar,
body[data-section="manga"] .author-match__photo { background: linear-gradient(135deg, #e0245e, #ff8a5c); }

/* Classifica dei giochi: piattaforme al posto del voto */
.rank__rating--plain { color: var(--muted); }

/* Liste miste: tipo dell'elemento sotto il titolo */
.shelf__kind {
  align-self: flex-start;
  margin-top: 3px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
}
.shelf__kind--manga { background: #d6336c; }
.shelf__kind--game { background: #4c6ef5; }

@media (max-width: 680px) {
  .buy-platforms { margin-top: 10px; }
  .buy-platforms__label { flex: 1 0 100%; }
  .hero--book .buy-platforms, .hero--book .hero__orig { grid-column: 1 / -1; }
  .hero--manga .hero__orig, .hero--game .hero__orig { grid-column: 2; padding-right: 30px; }
  .hero--game .hero__actions .btn--plat { flex: 0 0 auto; }
}

/* Telefoni: il nome va su due righe e la barra resta su una riga sola
   ("?" è anche nel piè di pagina, le classifiche nella barra dei generi) */
@media (max-width: 480px) {
  .brand { gap: 6px; }
  .brand__mark { width: 26px; height: 26px; }
  .brand__name { display: flex; flex-direction: column; font-size: 16.5px; line-height: 1; }
  .actions { gap: 6px; }
  #about-btn, .icon-btn--top { display: none; }
}

/* ---------- Film ---------- */

body[data-section="movies"] { --brand: #d9480f; }
@media (prefers-color-scheme: dark) { body[data-section="movies"] { --brand: #ff8f5a; } }

.hero__cast { margin: 4px 0 0; font-size: 14.5px; color: var(--muted); }
.hero__cast .author-link { color: var(--text); }

/* "Tratto dal libro …": il ponte verso la sezione Libri */
.based-on {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 12px 0 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 14px;
  max-width: 620px;
}
.based-on svg { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; color: #c0392b; }
.based-on a { color: var(--brand); font-weight: 600; text-decoration: none; white-space: nowrap; }
.based-on a:hover { text-decoration: underline; }

.hero__avatar--game.hero__avatar, .author-match__photo--movies, .sg__avatar--movies { background: linear-gradient(135deg, #4f46e5, #22b8cf); }
.hero--movie .hero__avatar:not(.hero__avatar--game),
.hero--movie .hero__avatar--game,
.author-match__photo--movies, .sg__avatar--movies { background: linear-gradient(135deg, #d9480f, #fab005); }
.hero__avatar--game span svg.ico-line, .author-match__photo--game svg.ico-line, .sg__avatar--game svg.ico-line { fill: none; stroke: #fff; }

.shelf__kind--movie { background: #d9480f; }

@media (max-width: 680px) {
  .hero--movie .hero__cast, .hero--book .based-on { grid-column: 1 / -1; }
}

/* Loghi di aziende e saghe: interi, su fondo chiaro, in un riquadro (non nel cerchio delle foto) */
.is-logo { border-radius: 14px !important; background: #fff !important; border: 1px solid var(--line); }
.is-logo > span { visibility: hidden; }
.is-logo img { object-fit: contain !important; object-position: center !important; padding: 12%; background: #fff; }
.sg__avatar.is-logo, .author-match__photo.is-logo { border-radius: 8px !important; }

/* ---------- Classifiche: albo d'oro, voto della critica, premi ---------- */

.rank__n--year { font-size: 15px; font-variant-numeric: tabular-nums; color: var(--muted); }
.rank--years .rank__n { min-width: 46px; }
.mc-score {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 22px;
  margin-left: 8px;
  padding: 0 5px;
  border-radius: 5px;
  vertical-align: 2px;
  font: 700 12.5px/1 var(--font);
  color: #fff;
}
.mc-score--hi { background: #2f9e44; }
.mc-score--mid { background: #f08c00; }
.mc-score--lo { background: #e03131; }
.rank__note { display: flex; align-items: flex-start; gap: 6px; margin-top: 5px; font-size: 12.5px; color: var(--muted); }
.rank__note svg { flex: 0 0 auto; width: 14px; height: 14px; margin-top: 1px; fill: #d4a017; }
@media (max-width: 680px) {
  .rank--years .rank__row { grid-template-columns: 42px 52px 1fr; }
  .rank__n--year { font-size: 13.5px; }
}
/* Libro senza copertina nell'albo d'oro: un dorso con il titolo */
.rank__cover--none { display: grid; place-items: center; aspect-ratio: 2 / 3; padding: 4px; border-radius: 3px; background: linear-gradient(160deg, #8d6e63, #5d4037); color: #fff; text-decoration: none; overflow: hidden; }
.rank__cover--none span { font: 600 9.5px/1.15 var(--serif); text-align: center; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }

/* Voto Metacritic nella scheda */
.fact--mc { gap: 7px; }
.fact--mc .mc-score { margin-left: 0; vertical-align: 0; }

/* Serie / saga: pulsante a parte sotto i generi */
.series-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn--series { gap: 8px; }
.btn--series svg { width: 16px; height: 16px; fill: currentColor; color: var(--brand); }
.btn--series strong { font-weight: 700; }
.btn--series__n { padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; }
@media (max-width: 680px) { .hero--book .series-links { grid-column: 1 / -1; } }
/* Copertina al posto del logo mancante: riquadro arrotondato, non cerchio */
.is-cover { border-radius: 14px !important; }
.is-cover > span { visibility: hidden; }
.is-cover img { object-position: center top !important; }

/* Logo: l'icona della sezione accanto al nome */
.brand__mark { display: inline-grid; place-items: center; color: var(--brand); }
.brand__mark svg { width: 100%; height: 100%; display: block; }
.brand__mark .ico-line { stroke-width: 1.8; }

.fact--mc .fact__sub { color: var(--muted); }

/* Voti critica + utenti allineati sulla stessa riga del testo */
.scores { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; vertical-align: middle; position: relative; top: -1px; }
.scores .mc-score { margin: 0; vertical-align: 0; }
.mc-score { height: 22px; }
.fact--mc { align-items: center; }
.fact--mc .mc-score { margin: 0 6px 0 0; }

/* =========================================================
   Tier list
   ========================================================= */

.btn--tier svg { width: 19px; height: 19px; fill: currentColor; }

/* ---------- Intestazione dell'editor ---------- */
.hero--tier { display: block; }
.tl-head { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tl-title {
  width: 100%;
  max-width: 760px;
  margin: 2px 0 0 -8px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: 600 32px/1.15 var(--serif);
  letter-spacing: -0.01em;
}
.tl-title:hover { border-color: var(--line); }
.tl-title:focus { outline: none; border-color: var(--focus); background: var(--surface); }
.tl-meta { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Tavola ---------- */
.tl { --cw: 66px; user-select: none; -webkit-user-select: none; }
.tl-board { display: flex; flex-direction: column; gap: 4px; border-radius: 12px; overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.tl-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) 36px;
  min-height: calc(var(--cw) * 1.5 + 12px);
  background: var(--surface);
  transition: background-color .12s;
}
.tl-label {
  display: grid;
  place-items: center;
  padding: 8px;
  border: 0;
  background: var(--tc);
  color: var(--ink);
  font: 700 30px/1.05 var(--serif);
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.tl--ro .tl-label { cursor: default; }
.tl-label--md { font-size: 20px; }
.tl-label--sm { font-size: 15px; }
.tl-label--xs { font-size: 12.5px; }
button.tl-label:hover { filter: brightness(1.04) saturate(1.05); }
.tl-zone {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
}
.tl-gear {
  display: grid;
  place-items: center;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}
.tl-gear svg { width: 18px; height: 18px; fill: currentColor; }
.tl-gear:hover { color: var(--text); }
.tl-row.is-over { background: color-mix(in srgb, var(--brand) 9%, var(--surface)); }
.tl.has-selection .tl-row, .tl.has-selection .tl-pool { cursor: pointer; }
.tl.has-selection .tl-row:hover { background: color-mix(in srgb, var(--focus) 8%, var(--surface)); }

/* ---------- Copertine ---------- */
.tl-card { position: relative; width: var(--cw); aspect-ratio: 2 / 3; flex: 0 0 auto; }
.tl-card__btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
  cursor: grab;
  touch-action: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.tl--ro .tl-card__btn { cursor: default; touch-action: auto; }
.tl-card__btn img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.tl-card__txt { display: grid; place-items: center; width: 100%; height: 100%; padding: 4px; font-size: 10.5px; line-height: 1.2; color: var(--text); text-align: center; overflow: hidden; }
@media (hover: hover) { .tl:not(.tl--ro) .tl-card__btn:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.25); } }
.tl-card__btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tl-card.is-selected .tl-card__btn { outline: 3px solid var(--brand); outline-offset: 2px; transform: translateY(-3px); box-shadow: 0 8px 18px rgba(0,0,0,.3); }
.tl-card.is-dragging { opacity: .28; }
.tl-card__x {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s;
}
.tl-card:hover .tl-card__x, .tl-card.is-selected .tl-card__x { opacity: 1; }
@media (hover: none) { .tl-card.is-selected .tl-card__x { opacity: 1; } .tl-card__x { display: none; } .tl-card.is-selected .tl-card__x { display: grid; } }
.tl.is-dragging .tl-card__x { display: none; }
.tl-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  margin: 0;
  pointer-events: none;
  list-style: none;
  filter: drop-shadow(0 14px 22px rgba(0,0,0,.45));
}
.tl-ghost .tl-card__btn { cursor: grabbing; }
.tl-ghost .tl-card__x { display: none; }
body:has(.tl-ghost) { cursor: grabbing; }

/* ---------- Da classificare ---------- */
.tl-pool {
  margin-top: 16px;
  padding: 12px 12px 8px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  transition: border-color .12s, background-color .12s;
}
.tl-pool.is-over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--surface-2)); }
.tl-pool__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-bottom: 4px; }
.tl-pool__head strong { font-size: 15px; }
.tl-pool__n { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-hint { flex: 1 1 260px; text-align: right; font-size: 12.5px; color: var(--muted); }
.tl.has-selection .tl-hint { color: var(--brand); font-weight: 600; }
.tl-zone--pool { min-height: calc(var(--cw) * 1.5 + 12px); padding-left: 0; padding-right: 0; }
.tl-pool__empty { margin: 4px 0 6px; font-size: 14px; color: var(--muted); }

/* ---------- Menu della fascia ---------- */
.tl-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 120;
  width: 288px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: rise .14s ease both;
}
.tl-menu__lab { display: block; margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tl-menu__name {
  display: block;
  width: 100%;
  height: 36px;
  margin: 4px 0 12px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font: 600 15px var(--font);
}
.tl-menu__name:focus { outline: none; border-color: var(--focus); }
.tl-menu__colors { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin-bottom: 14px; }
.tl-swatch { aspect-ratio: 1; border: 2px solid transparent; border-radius: 8px; background: var(--c); cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.tl-swatch.is-on { border-color: var(--text); }
.tl-menu__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tl-menu__grid button {
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.tl-menu__grid button:hover:not(:disabled) { border-color: var(--muted); }
.tl-menu__grid button:disabled { opacity: .4; cursor: default; }
.tl-menu__grid .is-danger { color: #c92a2a; }
@media (prefers-color-scheme: dark) { .tl-menu__grid .is-danger { color: #ff8787; } }

/* ---------- Aggiungi titoli ---------- */
.tl-add { margin: 0 0 18px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); animation: rise .16s ease both; }
.tl-add__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tl-add .segmented { flex-wrap: wrap; }
.tl-add .segmented__opt { border: 0; background: transparent; font: inherit; font-size: 13px; cursor: pointer; }
.tl-add__search { position: relative; flex: 1 1 240px; display: flex; align-items: center; }
.tl-add__search svg { position: absolute; left: 10px; width: 17px; height: 17px; fill: var(--muted); pointer-events: none; }
.tl-add__search input { width: 100%; height: 36px; padding: 0 10px 0 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.tl-add__search input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
.tl-add__note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.tl-add__note:empty { display: none; }
.tl-add__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; margin: 12px 0 0; padding: 0; list-style: none; max-height: 430px; overflow-y: auto; transition: opacity .15s; }
.tl-add__grid.is-loading { opacity: .5; }
.tl-res { position: relative; display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.tl-res img, .tl-res__nc { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.15); transition: transform .12s; }
.tl-res:hover img { transform: translateY(-2px); }
.tl-res__t { font-size: 12.5px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tl-res__m { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-res__add {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.tl-res.is-in { cursor: default; }
.tl-res.is-in img { opacity: .45; }
.tl-res.is-in .tl-res__add { background: #2f9e44; color: #fff; }

/* ---------- Elenco delle tier list ---------- */
.tlc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tlc {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
}
.tlc:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--muted); }
.tlc-art { display: flex; flex-direction: column; gap: 2px; padding: 10px; background: var(--surface-2); min-height: 150px; }
.tlc-row { display: flex; align-items: center; gap: 3px; height: 24px; }
.tlc-lab { flex: 0 0 26px; height: 100%; border-radius: 3px; background: var(--tc); }
.tlc-pool { display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 6px; height: 100%; min-height: 130px; }
.tlc-pool img, .tlc-pool i { width: 30px; height: 45px; object-fit: cover; border-radius: 3px; background: var(--line); box-shadow: var(--shadow-sm); }
.tlc-row img, .tlc-row i { width: 16px; height: 24px; object-fit: cover; border-radius: 2px; background: var(--line); }
.tlc-body { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; }
.tlc-body strong { font-size: 15.5px; }
.tlc-body span { font-size: 13px; color: var(--muted); }
.tlc--new { font: inherit; color: var(--text); cursor: pointer; text-align: left; padding: 0; }
.tlc-art--new { position: relative; }
.tlc-art--new .tlc-lab { opacity: .55; }
.tlc-art--new .tlc-row i { flex: 1; height: 100%; border-radius: 3px; background: color-mix(in srgb, var(--line) 60%, transparent); }

/* Filtro per sezione in "La mia lista" */
.secfilter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.secchip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  background: var(--surface);
  transition: border-color .15s, background-color .15s;
}
.secchip:hover { border-color: var(--muted); }
.secchip.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }
.secchip .sec-img { width: 20px; height: 20px; }
.secchip__n { font-weight: 500; font-size: 12.5px; color: var(--muted); }
.secchip.is-active .secchip__n { color: inherit; opacity: .7; }

/* ---------- Telefono ---------- */
@media (max-width: 680px) {
  .tl { --cw: 50px; }
  .tl-row { grid-template-columns: 64px minmax(0, 1fr) 30px; }
  .tl-label { font-size: 22px; padding: 4px; }
  .tl-label--md { font-size: 15px; }
  .tl-label--sm { font-size: 12px; }
  .tl-label--xs { font-size: 10.5px; }
  .tl-zone { gap: 4px; padding: 4px; }
  .tl-title { font-size: 25px; }
  .tl-hint { text-align: left; flex-basis: 100%; }
  .tl-add__grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); max-height: 360px; }
  .tl-menu { left: 8px !important; }
}

/* "Da classificare" resta sempre a portata di mano, in basso, mentre si scorrono le fasce */
.tl-pool {
  position: sticky;
  bottom: 10px;
  z-index: 20;
  max-height: 40vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-style: solid;
  box-shadow: 0 -8px 28px rgba(0,0,0,.18), var(--shadow-lg);
}
.tl-pool:has(.tl-pool__empty) { position: static; box-shadow: none; border-style: dashed; }
.tl-pool__head { position: sticky; top: -12px; z-index: 1; margin: -12px -12px 4px; padding: 10px 12px 6px; background: inherit; }
.tl-label { hyphens: auto; -webkit-hyphens: auto; }
.tl-label span { overflow-wrap: break-word; word-break: normal; }

/* ---------- Tier list: barra delle azioni ---------- */
.tl-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; margin-top: 14px; }
.tl-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: 600 14px var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s, background-color .15s, transform .1s;
}
.tl-btn:hover { border-color: var(--muted); }
.tl-btn:active { transform: scale(.97); }
.tl-btn svg { width: 17px; height: 17px; fill: currentColor; flex: 0 0 auto; }
.tl-btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.tl-btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.tl-btn__plus { font-size: 19px; font-weight: 500; line-height: 1; transition: transform .2s; }
.tl-btn--primary.is-open .tl-btn__plus { transform: rotate(45deg); }
.tl-btn--icon { width: 38px; padding: 0; justify-content: center; }
.tl-btn.is-busy { opacity: .7; cursor: progress; }
.tl-more { position: relative; margin-left: auto; }
.tl-more__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  min-width: 180px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: rise .14s ease both;
}
.tl-more__menu[hidden] { display: none; }
.tl-more__menu button {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: 500 14px var(--font);
  text-align: left;
  cursor: pointer;
}
.tl-more__menu button:hover, .tl-more__menu button:focus-visible { background: var(--surface-2); outline: none; }
.tl-more__menu .is-danger { color: #c92a2a; }
@media (prefers-color-scheme: dark) { .tl-more__menu .is-danger { color: #ff8787; } }

.tl-hint--touch { display: none; }

/* ---------- Telefono: barra compatta e vassoio "Da classificare" su una riga ---------- */
@media (max-width: 680px) {
  .tl-actions { gap: 6px; }
  .tl-btn { height: 40px; }
  .tl-btn:not(.tl-btn--primary) .tl-btn__l { display: none; }
  .tl-btn:not(.tl-btn--primary) { width: 40px; padding: 0; justify-content: center; }
  .tl-btn--primary { flex: 1 1 auto; justify-content: center; }

  .tl-pool {
    bottom: 0;
    margin: 14px calc(-1 * var(--gutter)) 0;
    padding: 8px var(--gutter) 10px;
    max-height: none;
    overflow: visible;
    border-radius: 16px 16px 0 0;
    border-width: 1px 0 0;
  }
  .tl-pool__head { position: static; margin: 0 0 6px; padding: 0; }
  .tl-hint { display: none; }
  .tl-hint--touch { display: block; flex-basis: 100%; font-size: 12px; text-align: left; }
  .tl.has-selection .tl-hint--touch { color: var(--brand); font-weight: 600; }
  .tl-zone--pool {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    min-height: 0;
    padding: 4px 2px 6px;
    --cw: 58px;
  }
  .tl-zone--pool .tl-card { scroll-snap-align: start; width: 58px; }
  /* nel vassoio: di lato si scorre, in su si trascina in una fascia */
  .tl-zone--pool .tl-card__btn { touch-action: pan-x; }
}
@media (min-width: 681px) {
  .tl-pool { max-height: min(30vh, 250px); }
}

/* Illustrazioni a colori delle sezioni (logo, tasto, tendina) */
.sec-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand__mark { width: 34px; height: 34px; }
.secbtn__icon { display: grid; place-items: center; width: 24px; height: 24px; }
.secbtn__icon .sec-img { width: 22px; height: 22px; }
.secmenu__icon { width: 34px; height: 34px; display: grid; place-items: center; }
.secmenu__item:not(.is-current) .secmenu__icon .sec-img { filter: saturate(.85); }
@media (max-width: 480px) { .brand__mark { width: 30px; height: 30px; } }

/* Loghi delle piattaforme (barra dei generi e scheda del gioco) */
.plat-logo { width: 16px; height: 16px; flex: 0 0 auto; color: var(--text); }
.plat-logo--duo { width: 33px; }
.genre.is-active .plat-logo { filter: drop-shadow(0 0 1.5px rgba(255,255,255,.9)); }
.genre.is-active .plat-logo path[fill="currentColor"] { fill: #fff; }
.fact--plats { gap: 12px; flex-wrap: wrap; }
.plat { display: inline-flex; align-items: center; gap: 5px; color: inherit; text-decoration: none; }
.plat:hover { color: var(--text); }
.plat .plat-logo { width: 15px; height: 15px; }
.plat .plat-logo--duo { width: 31px; }

/* ---------- Pagine statiche per Google (/it/film/…): visibili finché il sito non si apre ---------- */
.seo { max-width: 1100px; margin: 0 auto; padding: 28px 20px 40px; color: var(--text); }
.seo__head { display: flex; gap: 28px; align-items: flex-start; }
.seo__cover { width: 200px; height: auto; border-radius: var(--radius); box-shadow: var(--shadow-lg); flex: none; }
.seo__info { min-width: 0; }
.seo__kicker { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.seo h1 { margin: 0 0 10px; font-family: var(--serif); font-size: clamp(28px, 4vw, 40px); line-height: 1.1; }
.seo h2 { margin: 34px 0 12px; font-size: 18px; }
.seo p { margin: 0 0 8px; line-height: 1.5; }
.seo a { color: inherit; }
.seo__meta { color: var(--muted); }
.seo__text { max-width: 70ch; margin-top: 14px !important; }
.seo__src, .seo__note { font-size: 12px; color: var(--muted); }
.seo__buy { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 6px !important; }
.seo__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 16px 12px; }
.seo__grid a { display: block; text-decoration: none; font-size: 13px; line-height: 1.3; }
.seo__grid img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; background: var(--line); margin-bottom: 6px; }
.seo__grid span, .seo__names span { color: var(--muted); }
.seo__names { list-style: none; margin: 0; padding: 0; columns: 220px; column-gap: 24px; font-size: 14px; line-height: 1.8; }
@media (max-width: 640px) {
  .seo__head { flex-direction: column; gap: 16px; }
  .seo__cover { width: 150px; }
}
.foot__links a { color: inherit; }

/* ---------- Voto personale (mezze stelle, 1–10) ---------- */
.myrate { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin: 14px 0 4px; }
.myrate__label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.myrate__stars, .rated__stars { position: relative; display: inline-block; line-height: 0; }
.myrate__stars { cursor: pointer; border-radius: 6px; touch-action: manipulation; }
.myrate__stars:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.myrate__bg, .myrate__fill { display: flex; white-space: nowrap; }
.myrate__fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; transition: width .12s ease; }
.myrate__bg svg, .myrate__fill svg { flex: none; width: 30px; height: 30px; padding: 0 1px; }
.myrate__bg svg { fill: color-mix(in srgb, var(--muted) 35%, transparent); }
.myrate__fill svg { fill: #f5c518; }
.myrate.is-hover .myrate__fill svg { fill: #ffd84d; }
.myrate__val { min-width: 24px; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.myrate__clear { font-size: 13px; }

/* "Voti" in La mia lista */
.rated { list-style: none; margin: 0; padding: 0 var(--gutter); display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px 24px; }
.rated__item { display: flex; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.rated__cover { flex: none; width: 64px; aspect-ratio: 2 / 3; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
.rated__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rated__body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rated__title { font-weight: 700; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rated__title:hover { text-decoration: underline; }
.rated__meta { font-size: 13px; color: var(--muted); }
.rated__stars { display: inline-flex; align-items: center; margin-top: 2px; }
.rated__stars .myrate__bg svg, .rated__stars .myrate__fill svg { width: 18px; height: 18px; }
.rated__stars .myrate__fill { right: auto; }
.rated__stars b { position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%); line-height: 1; font-size: 14px; }
.rated__stars { padding-right: 34px; }

/* ---------- Trailer (nell'intestazione), dettagli e cast (tendine) ---------- */
.hero__side {
  flex: 0 0 clamp(200px, 22vw, 300px);
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin: 34px 52px 0 auto;   /* accanto al titolo, un po' più in basso (a sinistra della ×) */
}
.hero__side:empty { display: none; }
.hero__trailer {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  animation: rise .35s ease both;
}
.hero__trailer-img { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; box-shadow: var(--shadow-sm); }
.hero__trailer-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease, opacity .2s; }
.hero__trailer:hover .hero__trailer-img img { transform: scale(1.04); opacity: .85; }
.hero__trailer:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 10px; }
.hero__trailer-yt { font-weight: 600; letter-spacing: 0; text-transform: none; opacity: .85; }
.hero__trailer-label { display: block; margin-top: 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.yt__play { position: absolute; left: 50%; top: 50%; width: 52px; height: 37px; transform: translate(-50%, -50%); filter: drop-shadow(0 3px 10px rgba(0,0,0,.45)); transition: transform .2s ease; }
.hero__trailer:hover .yt__play { transform: translate(-50%, -50%) scale(1.08); }
.yt__play svg { width: 100%; height: 100%; }

.video { width: min(1100px, 94vw); max-width: none; padding: 0; border: 0; border-radius: 12px; background: #000; overflow: visible; }
.video::backdrop { background: rgba(0,0,0,.85); }
.video__frame { aspect-ratio: 16 / 9; }
.video__frame iframe { width: 100%; height: 100%; border: 0; border-radius: 12px; display: block; }
.video__close { position: absolute; top: -44px; right: 0; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.video__close:hover { background: rgba(255,255,255,.3); }
.video__frame > div:not(.video__msg), .video__frame iframe { width: 100%; height: 100%; border: 0; border-radius: 12px; display: block; }
.video__msg { position: relative; height: 100%; display: grid; place-items: center; padding: 24px; border-radius: 12px; overflow: hidden; text-align: center; color: #fff; background: #000 center / cover no-repeat; }
.video__msg::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(6px); }
.video__msg > div { position: relative; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.video__msg p { max-width: 440px; margin: 0; font-size: 17px; line-height: 1.5; }
.video__alt { font-size: 14px; color: rgba(255,255,255,.75); }
.video__alt:hover { color: #fff; }
.video__msg svg { width: 22px; height: 16px; margin-right: 4px; }

.extras { margin: 0 var(--gutter); padding: 6px 0 10px; border-bottom: 1px solid var(--line); }
.x-fold { border-top: 1px solid var(--line); }
.x-fold:first-child { border-top: 0; }
.x-fold summary { display: flex; align-items: center; gap: 10px; padding: 14px 0; cursor: pointer; list-style: none; font-size: 18px; font-weight: 700; }
.x-fold summary::-webkit-details-marker { display: none; }
.x-fold summary::before { content: ""; align-self: stretch; width: 4px; border-radius: 2px; background: #f5c518; }
.x-fold summary:hover .x-fold__title { text-decoration: underline; text-underline-offset: 3px; }
.x-fold summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.x-fold__chev { width: 20px; height: 20px; color: var(--muted); transition: transform .2s ease; }
.x-fold[open] .x-fold__chev { transform: rotate(180deg); }
.x-fold__body { padding: 0 0 18px; animation: rise .25s ease both; }
.x-h__n { font-size: 14px; font-weight: 500; color: var(--muted); }
.x-fold dl { margin: 0; }
.x-detgrid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 8px 56px; align-items: start; }
.x-detgrid--one { grid-template-columns: minmax(0, 760px); }
.x-sub { margin: 4px 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.x-col > .x-sub ~ .x-sub { margin-top: 22px; }
.x-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 10px; margin-top: 8px; }
.x-box > div { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.x-box span { font-size: 12.5px; color: var(--muted); }
.x-box strong { font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.x-specs .x-row { grid-template-columns: 150px minmax(0, 1fr); }
.x-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.x-row:last-child { border-bottom: 0; }
.x-row dt { font-weight: 700; }
.x-row dd { margin: 0; color: var(--muted); }
.x-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.x-links svg { width: 20px; height: 14px; }
.x-imdb b { display: inline-block; padding: 1px 4px; border-radius: 3px; background: #f5c518; color: #000; font-size: 12px; font-weight: 800; letter-spacing: -.02em; }
.x-src { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.cast { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px 24px; }
.cast__item a, .cast__item > div { display: flex; align-items: center; gap: 16px; color: inherit; text-decoration: none; }
.cast__photo { position: relative; flex: none; width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 20px; }
.cast__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.cast__text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cast__text strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cast__text span { font-size: 14.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cast__item a:hover strong { text-decoration: underline; }
@media (max-width: 980px) {
  .hero__side { flex-basis: 200px; margin-right: 40px; }
}

/* ---------- "Guardalo su": cerchi delle piattaforme ---------- */
.watch__label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.watch__row { display: grid; grid-template-columns: repeat(5, minmax(0, 46px)); gap: 8px; }
.watch__btn {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.watch__btn:hover { transform: translateY(-2px) scale(1.06); box-shadow: 0 0 0 1px rgba(255,255,255,.16), var(--shadow-lg); }
.watch__btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.watch__btn img { display: block; width: 52%; height: auto; }
.watch__btn--netflix { background: #000; }
.watch__btn--netflix img { width: 46%; }
.watch__btn--mubi { background: #000; }
.watch__btn--mubi img { width: 56%; }
.watch__btn--disneyplus { background: #0b1d5c; }
.watch__btn--disneyplus img { width: 70%; }
.watch__btn--primevideo { background: #00a8e1; }
.watch__btn--primevideo img { width: 64%; margin-top: 2px; }
.watch__btn--appletv { background: #f2f2f5; }
.watch__btn--appletv img { width: 56%; }
.watch__note { margin: 10px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
@media (max-width: 760px) {
  .cast { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cast__photo { width: 58px; height: 58px; }
  .x-row, .x-specs .x-row { grid-template-columns: 120px minmax(0, 1fr); }
  .x-detgrid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .rated { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  /* Telefono: trailer e piattaforme sotto i pulsanti */
  .hero__side { grid-column: 1 / -1; margin: 16px 0 0; gap: 16px; }
  .hero__trailer { display: flex; align-items: center; gap: 12px; }
  .watch__row { grid-template-columns: repeat(5, 44px); }
  .hero__trailer-img { flex: 0 0 120px; border-radius: 8px; }
  .hero__trailer-label { margin: 0; font-size: 14px; color: var(--text); }
  .yt__play { width: 40px; height: 28px; }
  .video__close { top: -48px; }
}

/* ---------- Account (facoltativo) ---------- */
.icon-btn[hidden] { display: none; }
.icon-btn--account { position: relative; }
.icon-btn--account svg { width: 20px; height: 20px; fill: currentColor; }
.icon-btn--account.is-in { color: var(--text); border-color: var(--muted); }
.account-dot { position: absolute; right: 3px; bottom: 3px; width: 9px; height: 9px; border-radius: 50%; background: #2f9e44; box-shadow: 0 0 0 2px var(--bg); }
.account-dot.is-error { background: #e8590c; }
.account { max-width: 440px; }
.acc-form { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 6px; }
.acc-label { font-size: 13px; font-weight: 700; }
.acc-input { height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; font-size: 16px; }
.acc-input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.acc-input--code { font-size: 26px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.acc-submit { height: 44px; justify-content: center; margin-top: 4px; }
.acc-err { margin: 0; font-size: 13.5px; color: #e8590c; }
.acc-alt { display: flex; justify-content: space-between; gap: 12px; margin: 6px 0 4px; font-size: 14px; }
.acc-privacy { font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.acc-user { display: flex; align-items: center; gap: 12px; margin: 16px 0 6px; }
.acc-user > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.acc-user small { color: var(--muted); font-size: 12.5px; }
.acc-user strong { overflow: hidden; text-overflow: ellipsis; }
.acc-avatar { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-weight: 800; font-size: 19px; }
.acc-sync { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); }
.acc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.acc-danger { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; }
.acc-banner { flex-basis: 100%; margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.acc-banner .link-btn { font-weight: 700; color: var(--text); }

/* ---------- La mia lista: seconda riga (sezioni | disposizione + backup) ---------- */
.mylist-bar { flex: 1 1 100%; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.mylist-bar .secfilter { margin: 0; }
.mylist-bar__end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.mylist-bar .backup-btn { margin-left: 0; }
.viewsw { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.viewsw__btn { width: 34px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; }
.viewsw__btn svg { width: 17px; height: 17px; fill: currentColor; }
.viewsw__btn:hover { color: var(--text); }
.viewsw__btn.is-active { background: var(--text); color: var(--bg); }
.viewsw__btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* Titoli: vista dettagliata */
.ilist { list-style: none; margin: 0; padding: 0 var(--gutter); display: flex; flex-direction: column; }
.ilist__item { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ilist__cover { flex: none; width: 70px; aspect-ratio: 2 / 3; border-radius: 4px; overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow-sm); }
.ilist__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ilist__body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.ilist__title { font-size: 16.5px; font-weight: 700; color: var(--text); text-decoration: none; }
.ilist__title:hover { text-decoration: underline; }
.ilist__meta { font-size: 14px; color: var(--muted); }
.ilist__sec { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.ilist__sec .sec-img { width: 16px; height: 16px; }
.ilist__rate { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; }
.ilist__amz { flex: none; }
.istars { position: relative; display: inline-block; line-height: 0; }
.istars .myrate__bg svg, .istars .myrate__fill svg { width: 18px; height: 18px; }
.istars--sm .myrate__bg svg, .istars--sm .myrate__fill svg { width: 15px; height: 15px; }

/* Titoli: griglia con stelle (Voti) */
.igrid { list-style: none; margin: 0; padding: 0 var(--gutter); display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 18px; }
.igrid li { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.igrid__cover { display: block; aspect-ratio: 2 / 3; border-radius: 4px; overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow-sm); transition: transform .2s ease; }
.igrid__cover:hover { transform: translateY(-3px); }
.igrid__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.igrid__title { font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Titoli: vista compatta (solo copertine) */
.icompact { list-style: none; margin: 0; padding: 0 var(--gutter); display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; }
.icompact a { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 3px; overflow: hidden; background: var(--surface-2); transition: transform .15s ease; }
.icompact a:hover { transform: scale(1.05); z-index: 1; }
.icompact img { width: 100%; height: 100%; object-fit: cover; display: block; }
.icompact__score { position: absolute; left: 4px; bottom: 4px; padding: 1px 5px; border-radius: 4px; background: rgba(0,0,0,.75); color: #f5c518; font-size: 11px; font-weight: 700; }

/* Liste e tier list: tre disposizioni */
.lcard__more { display: none; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.secmini { display: inline-flex; align-items: center; gap: 4px; }
.secmini .sec-img { width: 15px; height: 15px; }
.lgrid--detailed, .tlc-grid--detailed { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.lgrid--detailed .lcard, .tlc-grid--detailed .tlc { flex-direction: row; align-items: stretch; }
.lgrid--detailed .lcard__art { flex: 0 0 200px; height: 120px; }
.lgrid--detailed .lcard__art img { height: 104px; bottom: -10px; }
.lgrid--detailed .lcard__body, .tlc-grid--detailed .tlc-body { justify-content: center; padding: 14px 20px; }
.lgrid--detailed .lcard__more, .tlc-grid--detailed .lcard__more { display: flex; }
.lgrid--detailed .lcard--new .lcard__art--new i { height: 104px; bottom: -10px; }
.tlc-grid--detailed .tlc-art { flex: 0 0 220px; min-height: 0; }
.lgrid--compact, .tlc-grid--compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.lgrid--compact .lcard__art { height: 100px; }
.lgrid--compact .lcard__art img, .lgrid--compact .lcard__art--new i { height: 86px; bottom: -8px; }
.lgrid--compact .lcard__body { padding: 9px 12px 11px; }
.lgrid--compact .lcard__body strong { font-size: 15px; }
.lgrid--compact .lcard__body > span:not(.lcard__more), .tlc-grid--compact .tlc-body > span { display: none; }
.lgrid--compact .lcard--form { min-height: 150px; }
.tlc-grid--compact .tlc-art { min-height: 96px; padding: 7px; }
.tlc-grid--compact .tlc-row { height: 15px; }
.tlc-grid--compact .tlc-row img, .tlc-grid--compact .tlc-row i { width: 10px; height: 15px; }
.tlc-grid--compact .tlc-body { padding: 8px 12px; }
.tlc-grid--compact .tlc-body strong { font-size: 14px; }
.tlc-grid--compact .tlc-pool { min-height: 80px; }
.tlc-grid--compact .tlc-pool img, .tlc-grid--compact .tlc-pool i { width: 22px; height: 33px; }

@media (max-width: 680px) {
  .mylist-bar__end { margin-left: 0; }
  .ilist__amz span { display: none; }
  .ilist__cover { width: 56px; }
  .lgrid--detailed .lcard__art { flex-basis: 120px; height: 100px; }
  .lgrid--detailed .lcard__art img { height: 84px; }
  .tlc-grid--detailed .tlc-art { flex-basis: 130px; }
  .icompact { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
  .igrid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

/* ---------- Privacy e note legali ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: 28px var(--gutter) 48px; line-height: 1.65; }
.legal h1 { margin: 0 0 4px; font-family: var(--serif); font-size: clamp(28px, 4vw, 38px); }
.legal__updated { margin: 0 0 28px; font-size: 13px; color: var(--muted); }
.legal h2 { margin: 30px 0 8px; font-size: 19px; }
.legal p, .legal li { font-size: 15.5px; }
.legal ul { padding-left: 20px; }
.legal li { margin: 4px 0; }
.legal a { color: inherit; }

/* Serie TV con immagine orizzontale (titolo della serie): copertina larga nell'intestazione */
.hero--wide .hero__cover { width: 260px; aspect-ratio: 16 / 9; }
@media (max-width: 680px) {
  .hero--wide { grid-template-columns: 120px 1fr; }
  .hero--wide .hero__cover { width: 120px; }
}

/* ---------- Profilo ---------- */
.icon-btn--account.is-active, .icon-btn--account.is-in { color: var(--text); border-color: var(--muted); }
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-avatar { flex: none; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-family: var(--serif); font-size: 28px; font-weight: 600; }
.profile-avatar svg { width: 34px; height: 34px; fill: currentColor; }
.profile-head h1 { margin: 0; font-family: var(--serif); font-size: clamp(26px, 3.4vw, 36px); line-height: 1.1; }
.profile { padding: 6px var(--gutter) 30px; }
.pstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 10px; margin: 8px 0 30px; }
.pstat { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.pstat:hover { border-color: var(--muted); transform: translateY(-2px); }
.pstat svg { width: 20px; height: 20px; margin-bottom: 4px; }
.pstat strong { font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pstat span { font-size: 13px; color: var(--muted); }
.psec { margin: 0 0 34px; }
.psec__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 8px; }
.psec__head h2 { margin: 0; font-family: var(--serif); font-size: 24px; }
.psec__head .secfilter { margin: 0; }
.psec__sub { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.up-sec { margin: 18px 0 10px; font-size: 15px; }
.up-sec a { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.up-sec .sec-img { width: 22px; height: 22px; }
.prow { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: thin; }
.prow__item { flex: 0 0 128px; display: flex; flex-direction: column; gap: 5px; color: var(--text); text-decoration: none; min-width: 0; }
.prow__cover { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow-sm); transition: transform .2s ease; }
.prow__cover--wide img { object-fit: cover; object-position: center; }
.prow__item:hover .prow__cover { transform: translateY(-3px); }
.prow__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prow__badge { position: absolute; left: 6px; top: 6px; padding: 2px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 800; }
.prow__title { font-size: 13.5px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.prow__date { font-size: 12.5px; color: var(--muted); }
.prow--loading .prow__cover { animation: pulse 1.2s ease-in-out infinite; }
.plists { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.plist { display: grid; grid-template-columns: 92px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; }
.plist:hover { border-color: var(--muted); }
.plist__covers { grid-row: 1 / span 2; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; height: 46px; }
.plist__covers img, .plist__covers i { width: 100%; height: 46px; object-fit: cover; border-radius: 3px; background: var(--line); display: block; }
.plist strong { align-self: end; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist span { align-self: start; font-size: 12.5px; color: var(--muted); }

/* ---------- Impostazioni e importazioni ---------- */
.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; padding: 6px var(--gutter) 34px; }
.set-card { padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.set-card--wide { grid-column: 1 / -1; }
.set-card h2 { margin: 0 0 12px; font-size: 18px; }
.set-card p { margin: 0 0 12px; line-height: 1.5; }
.set-muted { color: var(--muted); font-size: 14px; }
.set-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.imp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.imp-src { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.imp-logo { padding: 4px 10px; border-radius: 6px; font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.imp-how { margin: 0 !important; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.imp-pick { position: relative; margin-top: auto; cursor: pointer; }
.imp-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.imp-pick svg { width: 15px; height: 15px; }
.imp-panel { margin-top: 18px; padding: 18px; border-radius: 12px; background: var(--surface-2); }
.imp-panel h3 { margin: 0 0 12px; font-size: 16px; }
.imp-groups { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.imp-groups label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; cursor: pointer; }
.imp-groups span { color: var(--muted); font-size: 14px; }
.imp-tag { padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px !important; }
.imp-miss summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.imp-miss p { font-size: 13px; color: var(--muted); }
.imp-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 8px 0 10px; }
.imp-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }
.imp-status { margin: 0; font-weight: 600; }
.imp-error { color: #e8590c; margin: 0; }
@media (max-width: 680px) {
  .settings { grid-template-columns: minmax(0, 1fr); }
  .prow__item { flex-basis: 104px; }
  .pstats { grid-template-columns: repeat(2, 1fr); }
}
@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.settings .segmented__opt { border: 0; background: transparent; font: inherit; font-size: 14px; padding: 7px 16px; cursor: pointer; }
.settings .segmented__opt.is-active { background: var(--text); color: var(--bg); }

/* ---------- Serie TV: stagioni ed episodi ---------- */
.ep-seasons { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: thin; }
.ep-season { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.ep-season strong { font-size: 14px; }
.ep-season span { font-size: 12px; color: var(--muted); }
.ep-season:hover { border-color: var(--muted); }
.ep-season.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }
.ep-season.is-active span { color: inherit; opacity: .7; }
.ep-head { display: flex; gap: 16px; align-items: flex-start; margin: 6px 0 14px; }
.ep-head__img { flex: none; width: 92px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; box-shadow: var(--shadow-sm); }
.ep-head h3 { margin: 0 0 4px; font-size: 18px; }
.ep-head__meta { margin: 0 0 6px; font-size: 13.5px; color: var(--muted); }
.ep-head__sum { margin: 0; font-size: 14px; line-height: 1.55; max-width: 75ch; }
.ep-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ep { border-top: 1px solid var(--line); }
.ep__row { width: 100%; display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ep__row:disabled { cursor: default; }
.ep__img { position: relative; flex: none; width: 150px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.ep__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ep__img b { font-size: 20px; color: var(--muted); }
.ep__img img + b { display: none; }
.ep__text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ep__text strong { font-size: 15.5px; }
.ep__soon { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-style: normal; font-size: 11px; font-weight: 800; vertical-align: 2px; }
.ep__meta { font-size: 13px; color: var(--muted); }
.ep__star { color: #f5c518; font-weight: 700; }
.ep__sum { font-size: 14px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep.is-open .ep__sum { display: block; -webkit-line-clamp: unset; color: var(--text); }
.ep--more .ep__row:hover strong { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 680px) {
  .ep__img { width: 104px; }
  .ep-head__img { width: 70px; }
}
.ep-head__sum { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
/* Schermi medi: trailer e piattaforme vanno sotto, invece di stringere il testo */
@media (min-width: 681px) and (max-width: 1050px) {
  .hero--side { flex-wrap: wrap; }
  .hero--side .hero__side { flex: 1 1 100%; flex-direction: row; align-items: flex-start; gap: 28px; margin: 6px 0 0; }
  .hero--side .hero__trailer { width: 240px; flex: none; }
  .hero--wide .hero__cover { width: 200px; }
}

/* ---------- Uscite in arrivo ---------- */
.upage { padding: 4px var(--gutter) 40px; }
.up-filter { margin: 4px 0 22px; }
.up-mine { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.up-mine__track { width: 38px; height: 22px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; }
.up-mine__track span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); box-shadow: var(--shadow-sm); transition: transform .2s; }
.up-mine.is-on .up-mine__track { background: var(--accent); }
.up-mine.is-on .up-mine__track span { transform: translateX(16px); }
.hero--upcoming .btn svg { width: 16px; height: 16px; }
.up-foryou { margin: 0 0 26px; padding: 18px 18px 6px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.up-foryou h2 { margin: 0 0 2px; font-family: var(--serif); font-size: 24px; }
.up-month { margin: 0 0 26px; }
.up-month__h { position: sticky; top: var(--topbar-h); z-index: 5; display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; padding: 10px 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); font-family: var(--serif); font-size: 24px; }
.up-month__h span { font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--muted); }
.up-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.upc { position: relative; display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; transition: border-color .15s, transform .15s; }
.upc:hover { border-color: var(--muted); transform: translateY(-2px); }
.upc__link { flex: 1; min-width: 0; display: flex; align-items: stretch; gap: 12px; padding: 10px; color: var(--text); text-decoration: none; }
.upc__date { flex: none; width: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px; background: var(--surface-2); }
.upc__date b { font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
.upc__date span { margin-top: 3px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
.upc__date--vague span { margin: 0; text-align: center; text-transform: none; font-weight: 600; letter-spacing: 0; }
.upc__cover { position: relative; flex: none; width: 64px; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow-sm); }
.upc__cover--wide img { object-position: center; }
.upc__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upc__cover.is-empty::after { content: attr(data-initial); position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 26px; color: var(--muted); }
.upc__body { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 2px 70px 2px 0; }
.upc__kind { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.upc__kind .sec-img { width: 15px; height: 15px; }
.upc__you { white-space: nowrap; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-style: normal; font-size: 10.5px; font-weight: 800; }
.upc__title { font-size: 15.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.upc__meta { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upc__why { font-size: 12px; color: var(--text); opacity: .8; }
.upc__when { margin-top: auto; font-size: 12.5px; font-weight: 700; color: var(--brand); }
.upc__actions { position: absolute; right: 8px; top: 8px; display: flex; gap: 4px; }
.upc__btn { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--muted); cursor: pointer; }
.upc__btn svg { width: 15px; height: 15px; fill: currentColor; }
.upc__btn:hover { color: var(--text); border-color: var(--muted); }
.upc__btn[aria-pressed="true"] { color: #e0245e; }
.up-skel { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.up-skel span { height: 118px; border-radius: 14px; background: var(--surface-2); animation: pulse 1.2s ease-in-out infinite; }
.icon-btn--soon svg, .icon-btn--discover svg { width: 19px; height: 19px; fill: currentColor; }
.icon-btn--soon.is-active, .icon-btn--discover.is-active { color: var(--text); border-color: var(--muted); }
@media (max-width: 680px) {
  .up-grid, .up-skel { grid-template-columns: minmax(0, 1fr); }
  .up-month__h { font-size: 20px; }
  /* i pulsanti restano in alto a destra: lo spazio lo prende solo la prima riga */
  .upc__body { padding-right: 0; }
  .upc__kind { padding-right: 68px; min-height: 26px; max-width: 100%; overflow: hidden; white-space: nowrap; }
  .upc__link { gap: 10px; }
  .upc__date { width: 40px; }
  .upc__cover { width: 56px; }
  .up-foryou { padding: 14px 10px 2px; margin-left: -4px; margin-right: -4px; }
}

/* Barra in alto: con Uscite e Scopri le icone sono di più, "Mescola" resta solo icona prima */
@media (min-width: 681px) and (max-width: 1180px) {
  #shuffle span { display: none; }
  #shuffle { width: 38px; padding: 0; justify-content: center; }
  .actions { gap: 6px; }
  .search { flex-basis: 180px; }
}
@media (max-width: 680px) {
  .actions { gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
  #about-btn { display: none; }   /* "Info" resta nel fondo della pagina */
}

/* ---------- Scopri ---------- */
.disc { padding: 4px var(--gutter) 40px; }
.disc__tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 22px; scrollbar-width: none; }
.disc__tabs::-webkit-scrollbar { display: none; }
.disc__tab { flex: none; display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font-weight: 700; text-decoration: none; transition: border-color .15s; }
.disc__tab .sec-img { width: 24px; height: 24px; }
.disc__tab:hover { border-color: var(--muted); }
.disc__tab.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }
.disc__body { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; }
.disc__filters { position: sticky; top: calc(var(--topbar-h) + 12px); max-height: calc(100vh - var(--topbar-h) - 24px); overflow-y: auto; padding: 4px 6px 16px 0; scrollbar-width: thin; }
.disc__panelhead h2 { margin: 0 0 6px; font-size: 18px; }
.dgroup { margin: 0 0 18px; padding: 0; border: 0; }
.dgroup legend { margin-bottom: 8px; padding: 0; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.dgroup legend small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.dopts { display: flex; flex-wrap: wrap; gap: 6px; }
.dopt { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; transition: border-color .12s, background-color .12s; }
.dopt:hover { border-color: var(--muted); }
.dopt.is-on { background: var(--text); border-color: var(--text); color: var(--bg); }
.dopt__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dc, var(--muted)); }
.dopt.is-on .dopt__dot { box-shadow: 0 0 0 2px var(--bg); }
.dopt__logo { width: 18px; height: 18px; padding: 3px; border-radius: 50%; object-fit: contain; }
.dyears { display: flex; gap: 10px; margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.dyears input { width: 78px; height: 32px; margin-left: 4px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
.dfoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.disc-close { display: none; }
.disc__bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 10px; }
.disc__count { font-size: 20px; font-family: var(--serif); }
.disc__open { display: none; }
.disc__sort { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.disc__sort select { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.disc__active { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 30px; margin-bottom: 16px; }
.dchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.dchip span { color: var(--muted); font-size: 15px; line-height: 1; }
.dchip:hover { border-color: var(--muted); }
.dhint { font-size: 13.5px; color: var(--muted); }
.disc__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 16px; }
.dcard a { display: flex; flex-direction: column; gap: 5px; color: var(--text); text-decoration: none; }
.dcard__cover { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow-sm); transition: transform .2s ease; }
.dcard a:hover .dcard__cover { transform: translateY(-3px); }
.dcard__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dcard--skel .dcard__cover { animation: pulse 1.2s ease-in-out infinite; }
.dcard__score { position: absolute; left: 6px; bottom: 6px; min-width: 30px; padding: 2px 6px; border-radius: 5px; color: #fff; font-size: 13px; font-weight: 800; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.dcard__score--good { background: #2f9e44; }
.dcard__score--mid { background: #e8a10c; color: #1b1b1b; }
.dcard__score--low { background: #c92a2a; }
.dcard__score--book { background: rgba(0,0,0,.78); color: #f5c518; }
.dcard__title { font-size: 14px; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dcard__sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dcard__streams { display: flex; gap: 4px; }
.dcard__st { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; }
.dcard__st img { width: 60%; height: auto; }
.disc__empty { grid-column: 1 / -1; padding: 30px 0; color: var(--muted); }
.disc__more { display: flex; justify-content: center; min-height: 1px; margin-top: 24px; }
.disc__spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--text); animation: discspin .8s linear infinite; }
.disc__spin[hidden] { display: none; }
@keyframes discspin { to { transform: rotate(360deg); } }
@media (max-width: 900px) {
  .disc__body { grid-template-columns: minmax(0, 1fr); }
  .disc__open { display: inline-flex; }
  .disc__filters { display: none; }
  body.disc-sheet .disc__filters { display: block; position: fixed; z-index: 80; left: 0; right: 0; bottom: 0; top: auto; max-height: 82vh; padding: 18px var(--gutter) 16px; border-radius: 18px 18px 0 0; background: var(--bg); box-shadow: 0 -12px 40px rgba(0,0,0,.45); animation: sheet-up .25s ease; }
  body.disc-sheet::after { content: ""; position: fixed; inset: 0; z-index: 79; background: rgba(0,0,0,.5); }
  body.disc-sheet .dfoot { position: sticky; bottom: -16px; padding: 12px 0 4px; background: var(--bg); }
  .disc-close { display: inline-flex; }
  .disc__grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 16px 10px; }
}
@media (max-width: 900px) {
  body.disc-sheet .dfoot { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
  body.disc-sheet .dfoot .btn { justify-content: center; white-space: nowrap; }
  body.disc-sheet .disc__filters { overflow-x: hidden; }
}

/* ================= Il mio calendario ================= */
.upc__btn--cal[aria-pressed="true"] { color: #fff; background: #2f6fde; border-color: #2f6fde; }
.cal-link { position: relative; }
.cal-link svg { width: 16px; height: 16px; fill: currentColor; }
.cal-link__n { margin-left: 2px; min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; background: #2f6fde; color: #fff; font-size: 11.5px; font-weight: 800; }
.cal-link.pop .cal-link__n { animation: calpop .35s ease; }
@keyframes calpop { 50% { transform: scale(1.35); } }

.cal { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; margin-top: 8px; }
.cal__skel { height: 520px; border-radius: 18px; background: var(--surface-2); animation: pulse 1.2s ease-in-out infinite; }
.cal__main { border: 1px solid var(--line); border-radius: 18px; padding: 18px 18px 14px; background: var(--surface); }
.cal__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 14px; }
.cal__month { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cal__month span { font-family: var(--font); font-size: 13.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.cal__nav { display: flex; align-items: center; gap: 6px; flex: none; }
.cal__navbtn, .cal__today { height: 36px; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 10px; cursor: pointer; font: inherit; }
.cal__navbtn { width: 36px; display: grid; place-items: center; }
.cal__navbtn svg { width: 18px; height: 18px; }
.cal__today { padding: 0 14px; font-size: 14px; font-weight: 600; }
.cal__navbtn:hover, .cal__today:hover { border-color: var(--muted); }
.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal__wd { padding: 2px 8px 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cal__day { position: relative; min-height: 104px; padding: 8px; display: flex; flex-direction: column; align-items: stretch; gap: 6px; text-align: left; border: 1px solid transparent; border-radius: 12px; background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.cal__day:hover { border-color: var(--muted); }
.cal__day.is-out { background: transparent; color: var(--muted); opacity: .55; }
.cal__day.is-past:not(.is-today) .cal__n { color: var(--muted); }
.cal__n { font-size: 14px; font-weight: 700; line-height: 1; width: 26px; height: 26px; display: grid; place-items: center; margin: -3px 0 0 -3px; border-radius: 50%; }
.cal__day.is-today .cal__n { background: var(--brand); color: #fff; }
.cal__day.has { background: color-mix(in srgb, #2f6fde 9%, var(--surface)); }
.cal__day.is-sel { border-color: #2f6fde; box-shadow: 0 0 0 1px #2f6fde inset; }
.cal__thumbs { display: flex; align-items: center; }
.cal__thumbs img, .cal__thumbs i { width: 30px; height: 44px; flex: none; object-fit: cover; border-radius: 5px; box-shadow: 0 0 0 2px var(--surface), var(--shadow-sm); background: var(--surface-2); }
.cal__thumbs > * + * { margin-left: -10px; }
.cal__thumbs i[data-initial]::before { content: attr(data-initial); display: grid; place-items: center; height: 100%; font-family: var(--serif); font-style: normal; color: var(--muted); }
.cal__thumbs b { margin-left: 6px; font-size: 12px; color: var(--muted); }
.cal__t { font-size: 12px; line-height: 1.25; font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cal__dots { display: none; }

.cal__side { position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 32px); overflow: auto; padding-right: 4px; }
.cal__sidehead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 4px 0 10px; }
.cal__sidehead h3 { margin: 0; font-size: 17px; }
.cal__sidehead--sub { margin-top: 22px; }
.cal__back { border: 0; background: none; padding: 0; color: #2f6fde; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.cal__none { color: var(--muted); font-size: 14.5px; margin: 6px 0 0; }
.cag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cag { position: relative; }
.cag__link { display: flex; gap: 12px; align-items: center; padding: 9px 40px 9px 10px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none; background: var(--surface); transition: border-color .15s; }
a.cag__link:hover { border-color: var(--muted); }
.cag__date { flex: none; width: 44px; display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.cag__date b { font-size: 21px; }
.cag__date span { font-size: 11.5px; text-transform: uppercase; font-weight: 700; color: var(--muted); letter-spacing: .03em; }
.cag__date--vague span { text-transform: none; font-size: 11px; text-align: center; letter-spacing: 0; }
.cag__cover { position: relative; flex: none; width: 40px; aspect-ratio: 2 / 3; border-radius: 5px; overflow: hidden; background: var(--surface-2); }
.cag__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cag__cover.is-empty::after { content: attr(data-initial); position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); color: var(--muted); }
.cag__body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cag__kind { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.cag__kind .sec-img { width: 13px; height: 13px; }
.cag__tag { font-style: normal; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 10.5px; }
.cag__title { font-size: 14.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cag__meta { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cag__when { font-size: 12px; font-weight: 700; color: var(--brand); }
.cag__rm { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.cag__rm svg { width: 15px; height: 15px; }
.cag__rm:hover { background: var(--surface-2); color: var(--text); }

.cal-empty { max-width: 460px; margin: 40px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cal-empty__icon { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 22px; background: color-mix(in srgb, #2f6fde 12%, var(--surface)); color: #2f6fde; }
.cal-empty__icon svg { width: 34px; height: 34px; fill: currentColor; }
.cal-empty h2 { margin: 6px 0 0; font-family: var(--serif); }
.cal-empty p { margin: 0 0 8px; color: var(--muted); line-height: 1.5; }

@media (max-width: 1100px) { .cal { grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; } .cal__day { min-height: 92px; } }
@media (max-width: 900px) {
  .cal { grid-template-columns: 1fr; }
  .cal__side { position: static; max-height: none; overflow: visible; scroll-margin-top: calc(var(--topbar-h) + 12px); }
}
@media (max-width: 640px) {
  .cal__main { padding: 12px 8px 10px; border-radius: 14px; }
  .cal__bar { margin-bottom: 10px; }
  .cal__month { font-size: 21px; gap: 8px; }
  .cal__month span { font-size: 12.5px; }
  .cal__navbtn, .cal__today { height: 34px; }
  .cal__navbtn { width: 34px; }
  .cal__today { padding: 0 10px; }
  .cal__grid { gap: 3px; }
  .cal__wd { padding: 2px 0 4px; text-align: center; font-size: 11px; }
  .cal__day { min-height: 52px; padding: 6px 2px; align-items: center; gap: 5px; border-radius: 10px; }
  .cal__n { margin: 0; }
  .cal__thumbs, .cal__t { display: none; }
  .cal__dots { display: flex; gap: 3px; }
  .cal__dots i { width: 5px; height: 5px; border-radius: 50%; background: #2f6fde; }
  .cal__day.is-today .cal__dots i { background: var(--brand); }
}

/* Scopri: loghi delle piattaforme su un tondo bianco */
.dopt__plat { width: 22px; height: 22px; margin: -2px 0 -2px -5px; display: grid; place-items: center; border-radius: 50%; background: #fff; flex: none; }
.dopt__plat .plat-logo { width: 14px; height: 14px; color: #1b2838; }
.dopt__plat--duo { width: auto; padding: 0 6px; border-radius: 999px; }
.dopt__plat--duo .plat-logo--duo { width: 28px; height: 14px; }

/* Profilo: i tuoi numeri */
.pyears { margin: 4px 0 18px; }
.pgoal { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "text form" "bar bar"; gap: 12px 20px; align-items: center; padding: 18px 20px; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.pgoal__text { grid-area: text; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pgoal__text strong { font-family: var(--serif); font-size: 22px; line-height: 1.2; }
.pgoal__text span:last-child { font-size: 14px; color: var(--muted); }
.pgoal__form { grid-area: form; display: flex; gap: 8px; }
.pgoal__form input { width: 76px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; font-size: 15px; text-align: center; }
.pgoal__bar { grid-area: bar; position: relative; height: 10px; border-radius: 999px; background: var(--surface-2); }
.pgoal__bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.pgoal__bar b { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--text); opacity: .55; }
.pmedias { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.pmedia { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; overflow: hidden; transition: border-color .15s, transform .15s; }
.pmedia::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--c1), var(--c2)); }
.pmedia:hover { border-color: var(--muted); transform: translateY(-2px); }
.pmedia.is-zero { opacity: .55; }
.pmedia__icon { width: 28px; height: 28px; margin-bottom: 6px; }
.pmedia__icon .sec-img, .pmedia__icon svg { width: 100%; height: 100%; object-fit: contain; }
.pmedia strong { font-size: 30px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.pmedia__name { font-weight: 700; font-size: 14px; }
.pmedia__sub { font-size: 12.5px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 34px; }
.pcard { padding: 18px 20px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); min-width: 0; }
.pcard--wide { grid-column: 1 / -1; }
.pcard h2 { margin: 0; font-family: var(--serif); font-size: 21px; }
.pcard__sub { margin: 3px 0 14px; font-size: 13.5px; color: var(--muted); }
.pchart { display: flex; align-items: stretch; gap: 6px; height: 150px; }
.pchart__col { position: relative; flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; min-width: 0; outline: none; cursor: default; }
.pchart__bar { display: block; border-radius: 4px 4px 0 0; background: var(--accent); opacity: .85; transition: opacity .15s; margin-bottom: 6px; }
.pchart__col.is-hi .pchart__bar { opacity: 1; }
.pchart__col:hover .pchart__bar, .pchart__col:focus-visible .pchart__bar { opacity: 1; }
.pchart__col.is-zero .pchart__bar { height: 2px !important; background: var(--line); opacity: 1; }
.pchart__lab { flex: none; height: 16px; font-size: 11.5px; line-height: 16px; color: var(--muted); text-align: center; text-transform: capitalize; white-space: nowrap; }
.pchart__col.is-hi .pchart__lab { color: var(--text); font-weight: 700; }
.pchart__col::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% - 14px); transform: translate(-50%, -4px); padding: 5px 9px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 2; }
.pchart__col:hover::after, .pchart__col:focus-visible::after { opacity: 1; }
.pchart__col:first-child::after { left: 0; transform: translate(0, -4px); }
.pchart__col:last-child::after { left: auto; right: 0; transform: translate(0, -4px); }
.pchart--votes, .pchart--dec { height: 120px; gap: 4px; }
.ppeople { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.ppeople a, .ppeople li > span { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; color: var(--text); text-decoration: none; }
.ppeople a:hover { background: var(--surface-2); }
.ppeople__icon { flex: none; width: 22px; height: 22px; }
.ppeople__icon .sec-img, .ppeople__icon svg { width: 100%; height: 100%; object-fit: contain; }
.ppeople__name { flex: 1; min-width: 0; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppeople__n { flex: none; min-width: 24px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); font-size: 12.5px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .pmedias { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pgrid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .pmedias { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pmedia:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .pgoal { grid-template-columns: minmax(0, 1fr); grid-template-areas: "text" "bar" "form"; padding: 16px; }
  .pcard { padding: 16px; }
  .pchart { gap: 3px; }
}
