

:root {
  --pen-vh: min(calc(3 * (100vh - 264px) / 7), 400px);
  --logo-h: clamp(40px, calc(var(--pen-vh) / 3), 135px);
}

.wrap { width: 100%; max-width: 1600px; margin: 0 auto; padding: 12px 16px 48px; }

input, select, button { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
}
.btn.primary { background: var(--amber); color: var(--blu); border-color: var(--amber); font-weight: 600; }

.st-back:hover { color: var(--titolo); }

header { margin-bottom: 12px; }

h1 {
  margin: 0 0 22px;
  display: flex; justify-content: center; align-items: flex-start;
  min-height: var(--logo-h);
}
h1 .titolo-testo {
  display: block; max-width: 100%; text-align: center; text-wrap: balance;
  line-height: 1.1;
  font-size: min(calc(var(--logo-h) * .56), 6.6vw);
  color: var(--titolo);
}


.bar { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; }
.sub { margin: 0; color: var(--muted); }
.avanz-riga { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.avanz-barra { width: min(300px, 55vw); height: 12px; border-radius: 99px; background: var(--line); overflow: hidden; flex: none; }
.avanz-barra span { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--amber); transition: width .4s ease; }
.avanz-barra.completa span { box-shadow: 0 0 10px var(--amber); }
.avanz-perc { font-size: .875rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
header h1:has(+ .info-serie) { min-height: 0; margin-bottom: 6px; }
header h1:not(:has(+ .info-serie)) { margin-bottom: 10px; }
.info-serie { margin: 0 0 26px; text-align: center; color: var(--muted); font-size: .9375rem; }
.descr-serie { width: fit-content; max-width: min(720px, 100%); box-sizing: border-box; margin: 36px 0 18px; padding: 14px 16px; border-radius: 12px; background: var(--riquadro); }
.descr-serie p { margin: 0; line-height: 1.55; }
.wrap > .hint-sopra { margin: 26px 0 10px; }
.wrap > .hint-sopra[hidden] { display: none; }
.descr-serie .descr-grazie { margin-top: 12px; color: var(--muted); font-size: .8125rem; }
.descr-serie .descr-grazie.corto { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.descr-serie .descr-grazie-apri { margin-top: 4px; padding: 0; border: 0; background: none; color: var(--amber); font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; text-decoration: underline; }
.descr-serie .descr-grazie::before { content: "♥\00a0"; color: var(--amber); }
.descr-serie .descr-conta { color: var(--muted); font-size: .9375rem; }
.descr-serie .descr-linea { margin: 12px 0; border: 0; border-top: 1px solid var(--line); }
.descr-scrivi { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.descr-scrivi-frase { flex: 1; text-align: center; color: var(--amber); font-weight: 700; line-height: 1.3; }
.descr-scrivi .btn { flex: none; padding: 8px 22px; border-width: 2px; border-color: var(--amber); background: rgba(242, 169, 0, .1); background: color-mix(in srgb, var(--amber) 10%, transparent); color: var(--amber); font-weight: 700; text-decoration: none; }
@media (max-width: 360px) { .descr-scrivi .btn { padding: 8px 14px; } }
:root:not([data-tema="scuro"]) .descr-scrivi-frase { color: var(--blu); }
:root:not([data-tema="scuro"]) .descr-scrivi .btn { border-color: var(--amber); background: var(--amber); color: #1A2140; }
@media (prefers-color-scheme: dark) {
  :root[data-tema="auto"] .descr-scrivi-frase { color: var(--amber); }
  :root[data-tema="auto"] .descr-scrivi .btn { border-color: var(--amber); background: rgba(242, 169, 0, .1); background: color-mix(in srgb, var(--amber) 10%, transparent); color: var(--amber); }
}
.conta-stampa { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.riga-bottoni { display: flex; gap: 8px; flex-wrap: wrap; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.riga-bottoni { display: none; }
.azioni-serie { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.azioni-serie .btn { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border-radius: 99px; font-size: .875rem; font-weight: 600; }
.azioni-serie svg { width: 17px; height: 17px; flex: none; }
.stato-testa { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.conta-stampa { width: min(420px, 100%); align-items: stretch; }
.conta-stampa .avanz-riga { margin-top: 0; }
.conta-stampa .avanz-barra { width: 100%; flex: 1; }
.tools select { -webkit-appearance: none; appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231A2140' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px; }
:root[data-tema="scuro"] .tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23EEF0F7' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) { :root[data-tema="auto"] .tools select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23EEF0F7' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); } }
@media (max-width: 520px) {
  .bar { display: block; }
  .conta-stampa { width: 100%; }
  .tools { flex-wrap: nowrap; margin-top: 12px; }
  .tools select { flex: 1 1 0; min-width: 0; }
  .tools .st-cerca { flex: none; }
  .tools:has(.st-cerca.open) { flex-wrap: wrap; }
  .tools .st-cerca.open { flex: 1 1 100%; }
  .tools .st-cerca.open input { flex: 1; width: auto; }
}
@media (max-width: 360px) {
  .tools { gap: 4px; }
  .tools select { padding-left: 8px; padding-right: 26px; background-position: right 9px center; }
  .tools .st-cerca button { padding: 8px 6px; }
}

select, .field input[type=text] {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.hint { color: var(--muted); font-size: .875rem; margin: 0 0 14px; }

.grid {
  list-style: none; margin: 0 auto; padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--colonne, 8), minmax(0, 1fr));
}
.grid.stretti { gap: 14px 5px; }
.grid.r-griglia:not(.stretti) { gap: 22px 14px; }

.grid.su-misura {
  --gap-x: 16px;
  --cella: calc(var(--altezza) / var(--proporzione));
  --min-col: max(90px, calc(var(--cella) * .6));
  gap: 28px var(--gap-x);
  max-width: calc(var(--colonne) * var(--cella) + (var(--colonne) - 1) * var(--gap-x));
  grid-template-columns: repeat(auto-fill, minmax(max(var(--min-col), calc((100% - (var(--colonne) - 1) * var(--gap-x)) / var(--colonne))), 1fr));
}
.grid.su-misura.stretti { --gap-x: 5px; --min-col: calc(var(--cella) * .88); row-gap: 14px; }
@media (max-width: 900px) {
  .grid.su-misura:not(.stretti) { --gap-x: 10px; row-gap: 22px; }
}

.pen {
  position: relative;
  container-type: inline-size; container-name: pen;
  min-width: 0;
  display: grid; gap: 6px; justify-items: stretch;
}
.pen .open {
  all: unset;
  display: block; width: 100%;
  cursor: pointer; border-radius: 10px;
}
.pen .open:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.pen .open:disabled { cursor: default; }

.pic {
  position: relative;
  display: block;
  height: 300px;
  height: clamp(150px, var(--pen-vh), calc(var(--proporzione, 7) * 100cqw));
}
.pic img {
  position: absolute; left: 50%; top: 6px;
  height: calc(100% - 12px); width: auto;
  max-width: 100%; object-fit: contain; object-position: center bottom;
  transform: translateX(-50%);
  display: block;
}

.pic img.pen-img { filter: var(--spento, grayscale(1) drop-shadow(0 0 1px rgba(90,100,130,.9))); opacity: var(--spento-op, .4); transition: opacity .3s ease; }
@media (hover: hover) { .pen .open:hover .pic img.pen-img { opacity: .6; } }
.pic img.ghost { filter: var(--sagoma, none); }
.pen.owned .pic img.pen-img,
.pen.owned .open:hover .pic img.pen-img { filter: none; opacity: 1; }

.pic img.halo {
  --hp: min(calc(100% - 12px), calc(100cqw / var(--ar, .001)));
  top: calc(100% - 6px - var(--hp) / 2); transform: translate(-50%, -50%);
  height: calc(var(--hp) * var(--k, 1.3)); max-width: none; object-fit: fill;
  opacity: 0; transition: opacity .3s ease; pointer-events: none;
}
.pen.owned .pic img.halo { opacity: 1; }
@supports not (width: 1cqw) { .pic img.halo { top: 50%; height: calc((100% - 12px) * var(--k, 1.3)); } }
.pen.owned .pic.no-halo img.pen-img { filter: drop-shadow(0 0 5px rgba(255, 196, 40, .95)) drop-shadow(0 0 12px rgba(255, 150, 20, .55)); }

.nome {
  display: flex; align-items: flex-end; justify-content: center;
  min-height: 2.5em;
  text-align: center;
  font-size: clamp(.72rem, .5rem + .35vw, .875rem);
  line-height: 1.25;
  color: var(--c-nome, var(--ink));
}
.nome span {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden; overflow-wrap: anywhere;
}

.code {
  display: block;
  width: 100%;
  text-align: center;
  font-weight: 700;
  font-size: clamp(.68rem, .4rem + .45vw, .9rem);
  line-height: 1.4;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 2px;
  color: var(--c-numero, var(--ink));
  white-space: nowrap; overflow: hidden;
  user-select: none;
}
.code.limited { color: var(--titolo); }
.code.none { color: var(--muted); font-weight: 400; }

.spunta {
  position: absolute; top: 2px; right: 2px; z-index: 1;
  width: clamp(16px, 22cqw, 26px); aspect-ratio: 1;
  box-sizing: border-box; border: 2px solid var(--muted); border-radius: 26%;
  background: color-mix(in srgb, var(--white) 85%, transparent);
}
.pen.owned .spunta { animation: spunta-pop .28s ease-out; }
@keyframes spunta-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.pen.owned .spunta {
  border-color: var(--amber);
  background: var(--amber) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M8.2 16.6l5.2 5 11.1-10.4' fill='none' stroke='%231A2140' stroke-width='4.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 88% no-repeat;
  box-shadow: 0 1px 4px rgba(26, 33, 64, .2);
}
@media (hover: hover) { .pen .open:hover .spunta { border-color: var(--amber); } }

.edit {
  width: 100%; height: 20px; padding: 0;
  background: var(--white); border: 1.5px solid var(--line); border-radius: 8px;
  color: var(--muted); font-family: inherit; font-size: .68rem; font-weight: 700; line-height: 17px; text-align: center;
}
.edit:hover { color: var(--amber); border-color: var(--amber); }

.pen.owned .code { border-color: var(--amber); background: rgba(242, 169, 0, .1); background: color-mix(in srgb, var(--amber) 10%, var(--white)); }

.doppi { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: .8125rem; color: var(--muted); }
.doppi .conta { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.doppi button { border: 0; background: none; padding: 1px 7px; font-size: 1rem; line-height: 1.2; color: var(--ink); }
.doppi button:hover { color: var(--amber); }
.doppi button:disabled { color: var(--line); cursor: default; }
.doppi .n { min-width: 14px; text-align: center; font-weight: 700; color: var(--ink); }
.doppi:not(.si) .conta { opacity: .55; transition: opacity .2s ease; }
.doppi:not(.si):hover .conta, .doppi:not(.si):focus-within .conta { opacity: 1; }
.doppi:not(.si) .conta { border-color: transparent; background: none; }
.doppi.si { color: var(--ink); font-weight: 600; }
.doppi.si .conta { border-color: var(--amber); }

.empty {
  border: 2px dashed var(--line);
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}

footer { margin-top: 48px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: .875rem; }
footer .hint { flex-basis: 100%; margin: 0 0 4px; }

dialog {
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--white); color: var(--ink);
  padding: 0; width: min(440px, 92vw);
}
dialog::backdrop { background: rgba(10, 14, 30, .55); }

.dlg-pic { position: relative; background: var(--white); height: min(320px, 42vh); padding: 12px; display: block; }
.dlg-pic img { width: 100%; height: 100%; object-fit: contain; }
.nophoto { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 16px; color: var(--muted); font-size: .9rem; }

.dlg-body { padding: 16px 20px 20px; display: grid; gap: 12px; }
.dlg-title { margin: 0; font: 600 1.35rem/1.2 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; }

.field { display: grid; gap: 4px; font-size: .875rem; color: var(--muted); }
.field input[type=text] { color: var(--ink); font-size: 1rem; width: 100%; }
.info { margin: 0; color: var(--c-info, var(--ink)); font-size: 1rem; white-space: pre-line; }
.info-foto { position: relative; }
.info-foto[hidden] { display: none; }
.if-scorri { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.if-scorri::-webkit-scrollbar { display: none; }
.if-scorri img { flex: 0 0 100%; width: 100%; height: min(240px, 34vh); object-fit: contain; scroll-snap-align: center; padding: 8px; box-sizing: border-box; }
.if-freccia { position: absolute; top: calc(50% - 14px); transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: color-mix(in srgb, var(--white) 90%, transparent); color: var(--ink); font-size: 1.3rem; line-height: 1; padding: 0 0 3px; cursor: pointer; }
.if-freccia:disabled { opacity: .3; cursor: default; }
.if-prec { left: 6px; } .if-succ { right: 6px; }
.if-punti { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.if-punti span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.if-punti span.on { background: var(--amber); }
.info-foto.una .if-freccia, .info-foto.una .if-punti { display: none; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { accent-color: var(--titolo); width: 18px; height: 18px; margin: 0; }

.trio { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; align-items: end; }
.trio:has(.colorbox) { grid-template-columns: 1.15fr 1.25fr 0.7fr; }
.trio .field input[type=text] { width: 100%; min-width: 0; }

dialog :focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
dialog input:focus-visible { outline-offset: 0; border-color: var(--amber); }
#editForm .btn.primary:hover { background: color-mix(in srgb, var(--amber) 88%, #000); border-color: color-mix(in srgb, var(--amber) 88%, #000); }

input[readonly] { pointer-events: none; }

.actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.spacer { flex: 1; }

.colorbox {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--white);
}
.colorbox input[type=text] {
  flex: 1; min-width: 0; height: 100%; border: 0; border-radius: 0; padding: 0;
  background: transparent; outline: none; color: var(--ink); font-size: 1rem;
}
.dot {
  flex: none; width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent;
}
.dot.empty { border-style: dashed; border-color: var(--muted); }


.choice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--amber); }
.choice input { margin: 4px 0 0; accent-color: var(--amber); width: 16px; height: 16px; flex: none; }
.choice small { display: block; color: var(--muted); font-size: .8125rem; line-height: 1.35; }
#printDlg .dlg-body:focus { outline: none; }
.choice-coppia { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-coppia .choice { margin: 0; padding: 10px; min-width: 0; }
.choice-coppia strong { white-space: nowrap; }
.choice.chiusa { opacity: .5; cursor: default; }
.print-accedi { margin: 10px 0 0; font-size: .8125rem; line-height: 1.4; color: var(--muted); }
.print-accedi button { padding: 0; border: 0; background: none; color: var(--amber); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }

@container pen (max-width: 90px) {
  .edit { width: 88%; justify-self: center; font-size: .62rem; }
  .doppi .etichetta { display: none; }
  .doppi { justify-content: center; }
}
@container pen (max-width: 60px) {
  .doppi button { padding: 0 3px; font-size: .875rem; }
  .doppi .n { min-width: 10px; font-size: .75rem; }
}

@media (max-width: 520px) {
  h1 .titolo-testo { font-size: 9vw; }
  .trio { gap: 8px; }
  .trio:has(.colorbox) { grid-template-columns: minmax(0, .85fr) minmax(0, 1.55fr) minmax(0, .6fr); }
  .trio .field input[type=text] { padding-left: 8px; padding-right: 6px; }
  .colorbox { padding: 0 6px 0 8px; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .pic img { transition: none !important; }
  .pen.owned .spunta { animation: none; }
}

.serie-titolo { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 32px 0 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.serie-titolo h2 { margin: 0; font: 900 1.2rem/1.2 "Arial Black", "Helvetica Neue", Arial, system-ui, sans-serif; letter-spacing: .02em; text-transform: uppercase; }
.serie-titolo a { color: var(--titolo); text-decoration: none; }
.serie-titolo a:hover { text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 3px; text-underline-offset: 5px; }
.serie-titolo small { color: var(--muted); font-size: .875rem; }
.serie-titolo .serie-scambi { margin-left: auto; align-self: center; padding: 6px 12px; border-radius: 8px; background: var(--amber); color: var(--blu); font-size: .8125rem; font-weight: 600; text-decoration: none; }
.serie-titolo .serie-scambi:hover { text-decoration: none; background: color-mix(in srgb, var(--amber) 88%, #000); }
.raccolta .empty .st-btn { margin-top: 12px; }
.non-cerco { display: block; margin: 10px 0 0 auto; padding: 4px 0; border: 0; background: none; color: var(--muted); font-size: .8125rem; text-decoration: underline; text-underline-offset: 3px; }
.non-cerco:hover { color: var(--ink); }
.pausa { margin-top: 36px; border-radius: 12px; background: var(--riquadro); }
.pausa summary { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; font-weight: 700; cursor: pointer; list-style: none; }
.pausa summary::-webkit-details-marker { display: none; }
.pausa summary::after { content: ""; width: 9px; height: 9px; border-right: 2.5px solid var(--amber); border-bottom: 2.5px solid var(--amber); transform: rotate(45deg); transition: transform .2s; }
.pausa[open] summary::after { transform: rotate(-135deg); }
.pausa-serie { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.pausa-serie b { display: block; color: var(--muted); }
.pausa-serie small { color: var(--muted); font-size: .8125rem; }
.pausa-serie .st-btn { flex: none; padding: 7px 14px; }
.cerca-aperta { width: min(460px, 100%); margin: 8px auto 24px; padding-left: 10px; }
.cerca-aperta svg { width: 20px; height: 20px; flex: none; }
.cerca-aperta.st-cerca input { flex: 1; width: auto; padding: 10px; opacity: 1; }
.raccolta .st-cards { margin-bottom: 8px; }
.raccolta .thumb { order: -1; display: grid; place-items: center; height: 150px; margin-bottom: 4px; }
.raccolta .thumb img { max-width: 100%; max-height: 150px; width: auto; height: auto; object-fit: contain; }
.raccolta .st-card p.avanz { flex: 0; font-size: .8125rem; }

.estere-titolo {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink);
}
.estere-titolo b { font-size: 1.05rem; }

.print-estere { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-size: .9375rem; cursor: pointer; }
.print-estere[hidden] { display: none; }
.print-estere input { accent-color: var(--amber); width: 16px; height: 16px; flex: none; margin: 0; }

.if-zoom { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; display: none; place-items: center; cursor: zoom-out; }
.if-zoom[open] { display: grid; }
.if-zoom::backdrop { background: rgba(0, 0, 0, .85); }
.if-zoom img { max-width: 96vw; max-height: 92vh; object-fit: contain; border-radius: 6px; background: #fff; }
.if-zoom-x { position: fixed; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; color: #111; font-size: 1.1rem; cursor: pointer; }

.festa-coriandoli { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 80; }
.festa-msg { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60; width: min(92vw, 440px);
  display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 20px; background: #1A2140 !important; color: #fff !important; border: 1px solid #3A4570;
  box-shadow: 0 10px 30px rgba(26, 33, 64, .35); transform: translate(-50%, calc(100% + 140px)); transition: transform .35s ease-in; }
body.con-barra .festa-msg { bottom: calc(76px + env(safe-area-inset-bottom)); }
.festa-msg.su { transform: translate(-50%, 0); transition: transform .45s cubic-bezier(.2, 1.3, .4, 1); }
.festa-msg .em { font-size: 2rem; line-height: 1; }
.festa-msg .tt b { display: block; font-size: 1.05rem; }
.festa-msg .tt b { color: #fff; }
.festa-msg .tt span { font-size: .82rem; color: #C9CEDD; }

.festa-msg button { font: inherit; border: 0; border-radius: 99px; cursor: pointer; white-space: nowrap; }
.festa-msg .condividi { padding: 7px 14px; font-weight: 700; background: #F2A900; color: #1A2140; }
.festa-msg .condividi:disabled { opacity: .6; cursor: progress; }

@media (prefers-reduced-motion: reduce) { .festa-msg { transition: none; } }


.grid.una-riga > li[hidden], .r-serie[hidden], .pausa-serie[hidden], .pausa[hidden] { display: none !important; }
.grid.una-riga > .altri { cursor: pointer; align-content: start; }
.grid.una-riga > .altri .pic { overflow: hidden; border-radius: 12px; }
.grid.una-riga > .altri img.sfocata { left: 50%; top: 6px; height: calc(100% - 12px); }
.grid.una-riga > .altri .code { border-color: var(--amber); background: rgba(242, 169, 0, .1); background: color-mix(in srgb, var(--amber) 10%, var(--white)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid.una-riga > .altri .bollo svg { width: 14px; height: 10px; flex: none; transition: transform .2s; }
.grid.una-riga > .altri.aperta .bollo svg { transform: rotate(180deg); }
.grid.una-riga > .altri:hover .bollo { transform: translate(-50%, -50%) scale(1.06); }
.grid.una-riga > .altri:hover .code { background: color-mix(in srgb, var(--amber) 22%, var(--white)); }
.stile-a .grid.una-riga > .altri img.sfocata { filter: blur(5px) grayscale(.4); opacity: .55; transform: translateX(-50%) scale(1.1); }
.stile-a .grid.una-riga > .altri .bollo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); transition: transform .2s;
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 46px; padding: 9px 6px 7px; border-radius: 12px;
  background: rgba(26,33,64,.5); border: 1px solid rgba(255,255,255,.25); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.stile-a .grid.una-riga > .altri .bollo b { font-size: .9375rem; line-height: 1; }
.stile-a .grid.una-riga > .altri .bollo svg { color: var(--amber); }
.stile-a .grid.una-riga > .altri.aperta .bollo { padding: 10px; }
.stile-b .grid.una-riga > .altri img.sfocata { filter: blur(2.5px); opacity: .5; transform: translateX(-50%);
  -webkit-mask-image: linear-gradient(#000 25%, transparent 85%); mask-image: linear-gradient(#000 25%, transparent 85%); }
.stile-b .grid.una-riga > .altri .bollo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); transition: transform .2s;
  display: grid; place-items: center; align-content: center; gap: 1px; width: 48px; height: 48px; border-radius: 50%;
  background: var(--amber); color: var(--blu); box-shadow: 0 0 0 5px color-mix(in srgb, var(--amber) 22%, transparent), 0 6px 16px rgba(0,0,0,.3); }
.stile-b .grid.una-riga > .altri .bollo b { font-size: .8125rem; line-height: 1; font-weight: 800; }
.stile-b .grid.una-riga > .altri .bollo svg { width: 11px; height: 8px; }
.grid.stretti.una-riga > .altri .code { font-size: .6875rem; }

.raccolta-tutte { --titolo: var(--ink); }
.raccolta-tutte h1 .titolo-testo { font-family: "Arial Black", "Helvetica Neue", Arial, system-ui, sans-serif; font-weight: 900; letter-spacing: .02em; }
.raccolta-tutte .tools { flex-wrap: wrap; }
.raccolta-tutte .cat-elenco { display: grid; gap: 10px; margin-top: 24px; }
@media (min-width: 640px) { .raccolta-tutte .cat-elenco { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (min-width: 1000px) { .raccolta-tutte .cat-elenco { grid-template-columns: repeat(3, 1fr); } }
.raccolta-tutte .cat-elenco[hidden] { display: none; }
.raccolta-tutte .cat-riga { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "nome vai" "conto vai" "mini vai"; align-items: center; gap: 4px 12px; width: 100%; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line)); border-radius: 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--amber) 14%, var(--white)), var(--white) 60%); color: var(--ink); text-align: left; font: inherit; cursor: pointer; transition: border-color .15s; }
.raccolta-tutte .cat-riga:has(.cat-barra) { grid-template-areas: "nome vai" "conto vai" "mini vai" "barra barra"; }
.raccolta-tutte .cat-riga:hover, .raccolta-tutte .cat-riga:focus-visible { border-color: var(--amber); }
.raccolta-tutte .cat-barra { grid-area: barra; height: 6px; margin-top: 10px; border-radius: 3px; background: color-mix(in srgb, var(--muted) 30%, transparent); overflow: hidden; }
.raccolta-tutte .cat-barra span { display: block; height: 100%; border-radius: 3px; background: var(--amber); }
.raccolta-tutte .cat-nome { grid-area: nome; font: 900 1.05rem/1.2 "Arial Black", "Helvetica Neue", Arial, system-ui, sans-serif; letter-spacing: .02em; }
.raccolta-tutte .cat-conto { grid-area: conto; color: var(--muted); font-size: .875rem; }
.raccolta-tutte .cat-mini { grid-area: mini; display: flex; gap: 6px; margin-top: 8px; height: 46px; overflow: hidden; }
.raccolta-tutte .cat-mini:empty { display: none; }
.raccolta-tutte .cat-mini img { height: 46px; width: 46px; object-fit: contain; padding: 3px; border-radius: 8px; background: var(--piastra, #F4F5F8); }
.raccolta-tutte .cat-vai { grid-area: vai; font-size: 1.8rem; line-height: 1; color: var(--amber); }
.raccolta-tutte .altre-serie { margin: 28px 0 8px; text-align: center; }
.raccolta-tutte .altre-serie[hidden] { display: none; }
@media (max-width: 520px) {
  .raccolta-tutte .tools #categoria { flex: 1 1 calc(100% - 56px); }
}

.coll-schede { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 2px 0 18px; }
.coll-schede a { padding: 8px 18px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-weight: 600; font-size: .95rem; text-decoration: none; transition: border-color .15s; }
.coll-schede a:hover { border-color: var(--amber); }
.coll-schede a[aria-current="page"] { background: var(--amber); border-color: var(--amber); color: var(--blu); }

.liste-elenco { display: grid; gap: 10px; margin-top: 8px; }
.liste-zero { color: var(--muted); margin: 18px 0 6px; }
@media (min-width: 700px) { .liste-elenco { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1050px) { .liste-elenco { grid-template-columns: 1fr 1fr 1fr; } }
.lista-scheda {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--white); color: var(--ink); text-decoration: none;
}
.lista-scheda:hover { border-color: var(--amber); }
.ls-mini { flex: none; display: flex; align-items: center; justify-content: center; width: 112px; height: 84px; border-radius: 12px; background: var(--crema); overflow: hidden; }
.ls-mini img { width: 40px; height: 72px; margin: 0 -3px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0,0,0,.18)); }
.ls-vuota { color: var(--muted); font-size: 1.6rem; }
.ls-testo { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ls-testo b { font-size: 1.05rem; line-height: 1.25; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.ls-testo small { color: var(--muted); font-size: .85rem; }
.lista-scheda .cat-vai { color: var(--muted); font-size: 1.4rem; }
.liste-nuova { margin-top: 16px; }
.liste-account { margin-top: 14px; color: var(--muted); font-size: .9rem; }
.liste-account .st-link { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.liste-conferma { margin: 10px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--riquadro); }
.liste-conferma p { margin: 0 0 10px; }
.liste-conferma .riga-bottoni { display: flex; gap: 8px; }
.liste-conferma .liste-si { border-color: var(--errore); background: var(--errore); color: #fff; }
.liste-persi { margin-top: 18px; color: var(--muted); font-size: .9rem; }
.lista-testa {
  position: relative; display: flex; align-items: center; gap: 12px; margin: 6px 0 18px; padding: 18px 16px 18px 24px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: 0 2px 10px rgba(10, 14, 30, .06); overflow: hidden;
}
.lista-testa::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: var(--amber); }
.lt-testo { flex: 1; min-width: 0; }
.lt-nome { display: block; min-height: 0; padding: 0; margin: 0; font-size: clamp(1.5rem, 6vw, 2.2rem); font-weight: 800; line-height: 1.15; text-align: left; color: var(--ink); overflow-wrap: anywhere; }
.lt-quanti { margin: 6px 0 0; color: var(--muted); font-size: 1.05rem; }
.lt-azioni { flex: none; display: grid; gap: 10px; justify-items: start; }
.lt-azione { display: inline-flex; align-items: center; gap: 6px; padding: 6px 4px; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; }
.lt-azione svg { width: 20px; height: 20px; }
.st-pin-menu .lt-rosso { color: var(--errore); }
.lista-rinomina { width: 100%; font-size: 1.4rem; font-weight: 700; }
.lista-mista { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; }
@media (min-width: 600px) { .lista-mista { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 900px) { .lista-mista { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .lista-mista { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.lista-pezzo { display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; }
.lp-foto { position: relative; display: flex; padding: 0; border: 0; cursor: pointer; font: inherit; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1; border-radius: 12px; background: var(--riquadro); overflow: hidden; }
.lp-foto img { max-width: 86%; max-height: 86%; object-fit: contain; }
.lista-pezzo.si .lp-foto, .lps-foto.si { background: color-mix(in srgb, var(--amber) 22%, var(--white)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--amber) 55%, transparent); }
.lista-pezzo.si .lp-foto::after, .lps-foto.si::after {
  content: "\2713"; position: absolute; top: 6px; right: 6px; display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px; background: var(--amber); color: #1A2140; font-weight: 800; font-size: 14px; line-height: 1;
}
.lp-num { margin-top: 6px; font-weight: 700; font-size: .85rem; color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-serie { font-size: .72rem; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lps-testa { display: flex; gap: 14px; align-items: center; }
.lps-foto { position: relative; flex: none; display: flex; align-items: center; justify-content: center; width: 104px; height: 104px; border-radius: 12px; background: var(--riquadro); }
.lps-foto img { max-width: 86%; max-height: 86%; object-fit: contain; }
.lps-testo { min-width: 0; }
.lps-testo h3 { margin: 0; font-size: 1.15rem; overflow-wrap: anywhere; }
.lps-testo p { margin: 3px 0 0; font-size: .9rem; color: var(--muted); }
.lps-testo .lps-serie a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.lps-testo .lps-stato { margin-top: 8px; font-weight: 600; }
.lps-testo .lps-stato.si { color: var(--ink); }
.lps-azioni { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.lps-azioni .st-btn { justify-content: center; text-align: center; }
.lps-togli { display: block; width: 100%; margin-top: 10px; padding: 11px; border: 1px solid var(--errore); border-radius: 10px; background: none; color: var(--errore); font: inherit; font-weight: 600; cursor: pointer; }
.lp-scheda .lp-fatto { margin-top: 14px; }
.lt-avanz { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.lt-avanz .avanz-barra { flex: 1; width: auto; }
.lt-avanz .avanz-perc { font-size: .95rem; color: var(--ink); }
.lt-quanti b { color: var(--ink); }
.lista-pezzo { position: relative; }
.lista-pezzo .lp-foto { background: var(--white); box-shadow: inset 0 0 0 1px var(--line), 0 1px 4px rgba(26,33,64,.07); }
.lista-pezzo .lp-foto img { filter: drop-shadow(0 2px 3px rgba(0,0,0,.15)); }
.lista-pezzo .lp-num { margin-top: 7px; }
.lp-i { position: absolute; left: 0; top: 0; z-index: 1; width: 36px; height: 36px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.lp-i span { width: 24px; height: 24px; border-radius: 50%; background: var(--white); border: 1px solid var(--line); color: var(--muted);
  display: grid; place-items: center; font: italic 700 13px/1 Georgia, serif; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.lp-i:hover span, .lp-i:focus-visible span { border-color: var(--amber); color: var(--ink); }
.lista-scheda { box-shadow: 0 1px 3px rgba(26,33,64,.06); }
.ls-testo b { font-size: 1.1rem; }
.ls-avanz { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.ls-avanz i { flex: 1; max-width: 120px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.ls-avanz i span { display: block; height: 100%; background: var(--amber); }
.ls-avanz small { font-size: .75rem; }
.liste-invito { margin: 6px 0 18px; padding: 18px 16px; border: 1px solid var(--crema-line); border-radius: 16px; background: var(--crema); text-align: center; }
.liste-invito h2 { margin: 0 0 6px; font-size: 1.25rem; }
.liste-invito p { margin: 0 0 14px; color: var(--muted); }
.liste-invito p b { color: var(--ink); }
.liste-invito .liste-gia { margin: 12px 0 0; font-size: .88rem; }
.liste-accedi { background: var(--amber); border-color: var(--amber); color: #1A2140; }
.liste-esempio { opacity: .55; pointer-events: none; filter: saturate(.85); }
.liste-esempio .lista-scheda { position: relative; }
.liste-esempio-tag { position: absolute; top: -10px; right: 10px; z-index: 1; padding: 2px 10px; border-radius: 99px; background: var(--ink); color: var(--white); font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.liste-blocco { margin: 0; color: var(--muted); font-size: .9rem; }
.liste-blocco .st-link { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
body.ag-aperto { overflow: hidden; }
.ag-pannello { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: var(--white); color: var(--ink); }
.ag-testa { display: flex; align-items: center; gap: 12px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.ag-testa > div { flex: 1; min-width: 0; }
.ag-testa h2 { margin: 0; font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-conto { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }

.ag-filtri { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
.ag-filtri .st-cerca { flex: 1 1 220px; margin: 0; }
.ag-filtri .ag-cerca { width: 100%; font-size: 1rem; }
.ag-filtri .ag-cat { flex: 0 1 auto; max-width: 100%; }
.ag-risultati { flex: 1; overflow-y: auto; padding: 4px 16px calc(24px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.ag-quanti { margin: 0 0 10px; color: var(--muted); font-size: .85rem; }
.ag-pezzo.dentro .lp-foto { background: color-mix(in srgb, var(--amber) 22%, var(--white)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--amber) 55%, transparent); }
.ag-segno { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 7px;
  background: var(--white); color: var(--ink); border: 1.5px solid var(--line); font-weight: 800; font-size: 16px; line-height: 1; }
.ag-pezzo.dentro .ag-segno { background: var(--amber); border-color: var(--amber); color: #1A2140; font-size: 14px; }
.lp-nome { font-size: .75rem; color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 900px) { .ag-pannello { inset: 4vh 8vw; border-radius: 18px; box-shadow: 0 20px 60px rgba(10, 14, 30, .35); } }
.lt-azioni { gap: 4px; }
.ag-testa .ag-fatto { flex: none; padding: 10px 22px; border: 0; border-radius: 10px; background: var(--ink); color: var(--white); font: inherit; font-weight: 600; cursor: pointer; }

.cr-sez { margin: 0 0 28px; }
.cr-sez.st-serie-trovate { margin: 0 0 28px; }
.cr-n { margin-left: 4px; font: 600 .85rem/1 system-ui, -apple-system, sans-serif; color: var(--muted); vertical-align: middle; }
.cr-chip { display: flex; flex-wrap: wrap; gap: 8px; }
.cr-chip a { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: inherit; font-weight: 600; text-decoration: none; }
.cr-chip a:hover, .cr-chip a:focus-visible { border-color: var(--amber); }
.cr-tit-pezzi { margin-top: 8px; }
.cr-cat { padding-top: 14px; border-top: 1px solid var(--line); }
.cr-cat-tit { margin: 0 0 12px; font-size: 1.05rem; }
.cr-piedi { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.cr-piedi:empty { display: none; }
.cr-solo { font-weight: 600; font-size: .9rem; color: inherit; }
.cr-sez .lp-serie { color: var(--muted); }
