/* ============================================================
   BRANI — scaletta, dettaglio, modulo.
   ============================================================ */

body:not([data-view="list"]) .sticker { display: none; }  /* l'adesivo + serve solo sulla scaletta */
body[data-view="list"] #brani { padding-bottom: 72px; }   /* spazio perché l'adesivo non copra l'ultima riga */

.muted { margin: 0; color: var(--ink-soft); }
.retry { margin-top: var(--s-4); }

.icon { display: inline-grid; place-items: center; flex: none; }
.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: square; }

/* ---------- Filtri ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 var(--s-6);
}
.filter {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 8px;
  border: 2px solid var(--ink);
  background: transparent;
  font-size: 14px;
  font-weight: 800;
  font-stretch: 72%;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: transform 140ms cubic-bezier(0.23, 1, 0.32, 1);
}
.filter__n { font-variant-numeric: tabular-nums; opacity: 0.7; }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.filter[aria-pressed="true"] .filter__n { opacity: 1; color: var(--yellow); }
.filter:active { transform: scale(0.96); }

/* ---------- Scaletta: righe del foglio ---------- */
.setlist { list-style: none; margin: 0; padding: var(--s-4) 0 var(--s-2); }

.song {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-4) var(--s-4) var(--s-3);
  border-bottom: 1.5px solid rgb(20 19 18 / 0.75);
}
.song:last-child { border-bottom: 0; }

.song__main {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: var(--s-2);
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.song__rank {
  padding-top: 2px;
  font-family: "Anton", sans-serif;
  font-size: 28px;
  line-height: 1;
  text-align: center;
}
.song__body { display: grid; gap: 5px; min-width: 0; }
.song__title {
  font-size: 25px;
  font-weight: 900;
  font-stretch: 70%;
  text-transform: uppercase;
  line-height: 0.95;
  overflow-wrap: anywhere;
}
.song__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.25;
}
@media (hover: hover) and (pointer: fine) {
  .song__main:hover .song__title { text-decoration: underline 3px var(--magenta); text-underline-offset: 4px; }
}

.tag {
  display: inline-block;
  padding: 2px 6px 1px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 800;
  font-stretch: 80%;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.3;
}

/* iniziali della band: vuoto = non ancora, giallo a retino = studia, verde = la sa */
.marks { display: flex; gap: 4px; margin: 3px 0 0; padding: 0; list-style: none; }
.mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}
.mark--studying {
  background:
    radial-gradient(rgb(20 19 18 / 0.35) 0.8px, transparent 1.1px) 0 0 / 4px 4px,
    var(--yellow);
}
.mark--ready { background: var(--green); }

/* il bottone voto */
.vote {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0;
  width: 56px;
  min-height: 60px;
  padding: 4px 0;
  border: 2.5px solid var(--ink);
  background: #f7f7f5;
  transition: transform 140ms cubic-bezier(0.23, 1, 0.32, 1), background-color 120ms ease;
}
.vote .icon svg { width: 22px; height: 22px; stroke-width: 3; }
.vote__n {
  font-family: "Anton", sans-serif;
  font-size: 22px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.vote[aria-pressed="true"] { background: var(--magenta); }
.vote:active { transform: scale(0.94); }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--tap);
  padding: 0 var(--s-5);
  border: 2.5px solid var(--ink);
  background: #f7f7f5;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  font-stretch: 85%;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: transform 140ms cubic-bezier(0.23, 1, 0.32, 1);
}
.btn:active { transform: scale(0.97); }
.btn--primary { width: 100%; min-height: 60px; background: var(--magenta); font-size: 19px; }
.btn--listen { flex: 1; padding-inline: var(--s-3); background: var(--ink); color: var(--paper); font-stretch: 75%; white-space: nowrap; }
.btn--quiet { border-color: transparent; background: transparent; padding-inline: 0; color: var(--ink-soft); text-decoration: underline 1.5px; text-underline-offset: 4px; }

.back {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  margin: -8px 0 var(--s-3) -4px;
  padding-right: var(--s-3);
  font-size: 15px;
  font-weight: 800;
  font-stretch: 80%;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
}

/* ---------- Dettaglio brano ---------- */
.song-page { max-width: 640px; }
.song-page__title {
  margin: 0;
  font-size: clamp(38px, 11vw, 56px);
  font-weight: 900;
  font-stretch: 68%;
  text-transform: uppercase;
  line-height: 0.9;
  text-wrap: balance;
  overflow-wrap: anywhere;
  /* stampa fuori registro: la copia magenta spostata */
  text-shadow: var(--misreg-x) var(--misreg-y) 0 var(--magenta);
}
.song-page__title:focus { outline: none; }
.song-page__artist { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: var(--s-2) 0 0; font-size: 21px; font-weight: 700; }
.song-page__by { margin-top: 2px; font-size: 15px; }

.song-page__actions { display: flex; gap: var(--s-3); align-items: stretch; margin: var(--s-5) 0; }
.song-page__actions .vote { grid-auto-flow: column; gap: 6px; width: auto; min-height: 56px; padding: 0 var(--s-4); }
.vote__label { font-size: 15px; font-weight: 800; font-stretch: 80%; text-transform: uppercase; letter-spacing: 0.04em; }

.notes {
  position: relative;
  margin: 0 0 var(--s-2);
  padding: var(--s-4);
  background: #f7f7f5;
  rotate: 0.4deg;
}
.notes p { margin: 0; }
.notes p + p { margin-top: var(--s-2); }
.notes__text { white-space: pre-line; }

.h3 {
  margin: var(--s-6) 0 var(--s-3);
  font-size: 15px;
  font-weight: 800;
  font-stretch: 80%;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* il tuo stato: 3 bottoni attaccati */
.segs { display: grid; grid-template-columns: repeat(3, 1fr); }
.seg {
  min-height: 64px;
  padding: var(--s-2);
  border: 2.5px solid var(--ink);
  background: #f7f7f5;
  font-size: 15px;
  font-weight: 800;
  font-stretch: 80%;
  line-height: 1.1;
  text-transform: uppercase;
  transition: transform 140ms cubic-bezier(0.23, 1, 0.32, 1);
}
.seg + .seg { border-left-width: 0; }
.seg:active { transform: scale(0.97); }
.seg[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg--studying[aria-pressed="true"] { background: var(--yellow); color: var(--ink); box-shadow: inset 0 0 0 3px var(--ink); }
.seg--ready[aria-pressed="true"] { background: var(--green); color: var(--ink); box-shadow: inset 0 0 0 3px var(--ink); }

.band-list { margin: 0; padding: 0; list-style: none; }
.band-list__row {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 10px 0;
  border-bottom: 1.5px solid rgb(20 19 18 / 0.3);
}
.band-list__name { font-weight: 800; }
.band-list__st { color: var(--ink-soft); }
.band-list__row.is-studying .band-list__st,
.band-list__row.is-ready .band-list__st { padding: 0 6px; color: var(--ink); font-weight: 700; }
.band-list__row.is-studying .band-list__st { background: var(--yellow); }
.band-list__row.is-ready .band-list__st { background: var(--green); }

.comments { display: grid; gap: var(--s-3); margin: 0 0 var(--s-5); padding: 0; list-style: none; }
.comment {
  padding: var(--s-3) var(--s-4);
  background: #f7f7f5;
  rotate: var(--r, -0.3deg);
}
.comment:nth-child(even) { --r: 0.35deg; }
.comment:focus { outline: none; }
.comment p { margin: 0; }
.comment__head { font-size: 14px; color: var(--ink-soft); }
.comment__head strong { color: var(--ink); text-transform: uppercase; font-stretch: 80%; letter-spacing: 0.03em; }
.comment__text { white-space: pre-line; overflow-wrap: anywhere; }

.comment-form { display: grid; gap: var(--s-2); margin-top: var(--s-4); }
.comment-form .btn { justify-self: start; }
.song-page > .btn--quiet { margin-top: var(--s-6); }

/* ---------- Modulo ---------- */
.form { display: grid; gap: var(--s-5); max-width: 640px; }
.field { display: grid; gap: 6px; }
.label {
  font-size: 14px;
  font-weight: 800;
  font-stretch: 80%;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.label em { font-style: normal; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink-soft); }

input, textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: #f7f7f5;
  color: var(--ink);
  font: inherit;
  font-size: 17px;                     /* ≥16px: l'iPhone non fa zoom */
}
textarea { resize: vertical; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: #6b6863; }
input:focus-visible, textarea:focus-visible { outline: 3px solid var(--magenta); outline-offset: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.chip {
  min-height: 40px;
  padding: 0 var(--s-3);
  border: 2px solid var(--ink);
  background: transparent;
  font-size: 15px;
  font-weight: 700;
  font-stretch: 85%;
}
.chip[aria-pressed="true"] { background: var(--yellow); }

@media (prefers-reduced-motion: reduce) {
  .filter, .vote, .btn, .seg { transition: none; }
}
