/* VA-List, bozza grafica: pagina del bot per Discord.
   La finestra di Discord ha i suoi grigi (e' un'altra app) e resta scura anche con il tema chiaro, come il tabellone della home.
   Tutto il resto usa i colori e i pezzi del sito. */

/* ---------- Piccoli pezzi condivisi ---------- */

.dc-tag {
  display: inline-grid;
  place-items: center;
  height: 17px;
  padding: 0 5px;
  border-radius: 4px;
  background: #5865f2;
  color: #fff;
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
}
.dc-chev {
  display: inline-block;
  flex: none;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.7;
  transform: translateY(-2px) rotate(45deg);
}

/* Link con freccia: area di tocco di almeno 40 px */
.link-freccia { min-height: 40px; }

/* ---------- Scheda del bot (apertura) ---------- */

.bot-scheda {
  overflow: hidden;
  border-radius: var(--r-xl);
  background: var(--surface);
  outline: 1px solid var(--line);
  outline-offset: -1px;
  box-shadow: var(--ombra-2);
}
.bot-scheda__fascia {
  position: relative;
  height: 76px;
  overflow: hidden;
  background: linear-gradient(160deg, #1f3158, #0e182e);
}
.bot-scheda__fascia svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.bot-scheda__fascia path {
  fill: none;
  stroke: rgb(255 255 255 / 0.4);
  stroke-width: 1;
  stroke-dasharray: 2 7;
  vector-effect: non-scaling-stroke;
}
.bot-scheda__fascia circle { fill: var(--accent); }
.bot-scheda__corpo { padding: 0 22px 22px; }
.bot-scheda__avatar {
  position: relative;
  z-index: 1;
  display: block;
  width: 76px;
  height: 76px;
  margin-top: -38px;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: 0 0 0 5px var(--surface);
}
.bot-scheda__avatar svg { display: block; width: 100%; height: 100%; }
.bot-scheda__nome { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; }
.bot-scheda__nome h2 { font-size: 26px; letter-spacing: -0.03em; }
.bot-scheda__sotto { margin-top: 2px; color: var(--text-3); font-family: var(--mono); font-size: 12.5px; }
.bot-scheda__testo { margin-top: 14px; color: var(--text-2); font-size: 15.5px; }
.bot-scheda__cifre {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
  overflow: hidden;
  border-radius: var(--r-m);
  background: var(--surface-2);
  outline: 1px solid var(--line);
  outline-offset: -1px;
}
.bot-scheda__cifre > div { padding: 12px 14px; border-left: 1px solid var(--line); }
.bot-scheda__cifre > div:first-child { border-left: 0; }
.bot-scheda__cifre dt { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.bot-scheda__cifre dd { margin-top: 2px; font-size: 26px; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

/* ---------- Finestra di Discord ---------- */

.dc {
  --dc-rail: #12141b;
  --dc-side: #1a1d26;
  --dc-chat: #222633;
  --dc-embed: #1b1e29;
  --dc-line: rgb(255 255 255 / 0.07);
  --dc-text: #e6e9f1;
  --dc-muted: #98a1b5;
  --dc-link: #72b6ff;
  display: grid;
  grid-template-columns: 72px 232px minmax(0, 1fr);
  max-width: 1040px;
  margin-inline: auto;
  overflow: hidden;
  border-radius: var(--r-l);
  background: var(--dc-chat);
  color: var(--dc-text);
  font-size: 15px;
  line-height: 1.4;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.07), 0 50px 90px -50px rgb(0 0 0 / 0.85);
}
:root[data-theme="light"] .dc {
  box-shadow: 0 0 0 1px rgb(10 16 30 / 0.4), 0 40px 70px -36px rgb(16 28 56 / 0.55);
}
/* Nel tema scuro la finestra sta su un fondo quasi uguale: il filo intorno la stacca (come il tabellone della home) */
:root[data-theme="dark"] .dc {
  box-shadow: 0 0 0 1px rgb(150 172 214 / 0.22), 0 50px 90px -50px rgb(0 0 0 / 0.85);
}
.dc b { font-weight: 600; }
.dc p { margin: 0; }

.dc__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  background: var(--dc-rail);
}
.dc-srv {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #2b2f3c;
  color: var(--dc-muted);
  font-size: 15px;
  font-weight: 600;
}
.dc-srv--home { background: #3a3f52; color: #dfe3ee; }
.dc-srv--home .icona { width: 24px; height: 24px; }
.dc-srv--attivo { border-radius: 16px; background: var(--accent); color: var(--accent-ink); }
.dc-sep { width: 32px; height: 2px; border-radius: 2px; background: rgb(255 255 255 / 0.1); }

.dc__canali { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; background: var(--dc-side); color: #8d96ab; }
.dc__srvnome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 48px;
  padding: 0 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--dc-line);
  color: #fff;
  font-size: 15px;
}
.dc__srvnome b { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dc-cat { padding: 14px 16px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.dc-can {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
}
.dc-can span { width: 14px; color: #949cb0; font-size: 18px; line-height: 1; text-align: center; }
.dc-can--attivo { background: rgb(255 255 255 / 0.08); color: #fff; }

.dc__chat { display: flex; flex-direction: column; min-width: 0; }
.dc__testa {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--dc-line);
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.12);
}
.dc__hash { color: #9aa2b6; font-size: 22px; line-height: 1; }
.dc__argomento {
  min-width: 0;
  margin-left: 6px;
  padding-left: 14px;
  overflow: hidden;
  border-left: 1px solid rgb(255 255 255 / 0.14);
  color: var(--dc-muted);
  font-size: 13.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dc__messaggi { display: grid; align-content: start; padding: 8px 0 6px; }
.dc-giorno {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 16px 4px;
  color: var(--dc-muted);
  font-size: 12px;
  font-weight: 600;
}
.dc-giorno::before, .dc-giorno::after { content: ""; flex: 1; height: 1px; background: rgb(255 255 255 / 0.1); }
.dc-mess {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 0 16px;
  padding: 8px 16px 10px;
  transition: background-color 0.2s;
}
.dc-mess:hover { background: rgb(255 255 255 / 0.025); }
.dc-avatar { display: block; width: 40px; height: 40px; overflow: hidden; border-radius: 50%; }
.dc-avatar svg { display: block; width: 100%; height: 100%; }
.dc-mess__corpo { min-width: 0; overflow-wrap: anywhere; }
.dc-mess__testa { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.dc-mess__testa b { color: #fff; font-size: 15.5px; }
.dc-mess__testa span:last-child { color: var(--dc-muted); font-size: 12px; }
.dc-mess__testo { margin-top: 2px; color: var(--dc-text); }
.dc-mess__testo b { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.dc-mention { padding: 0 3px; border-radius: 4px; background: rgb(88 101 242 / 0.3); color: #cdd3ff; font-weight: 500; }

/* Embed: la striscia a sinistra e' il giallo del sito */
.dc-embed {
  display: flex;
  gap: 14px;
  max-width: 520px;
  margin-top: 6px;
  padding: 10px 14px 12px 12px;
  border-left: 4px solid var(--accent);
  border-radius: 4px 8px 8px 4px;
  background: var(--dc-embed);
}
.dc-embed__corpo { flex: 1; min-width: 0; }
.dc-embed__autore { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--dc-text); font-size: 13px; font-weight: 600; }
.dc-embed__autore .dc-avatar { width: 22px; height: 22px; flex: none; }
.dc-embed__autore .dc-iniziali {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  background: hsl(var(--tinta) 42% 34%);
  color: hsl(var(--tinta) 80% 92%);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}
.dc-embed__titolo { display: block; color: var(--dc-link); font-size: 16px; font-weight: 650; line-height: 1.3; }
a.dc-embed__titolo:hover { text-decoration: underline; text-underline-offset: 3px; }
.dc-embed__testo { margin-top: 4px; color: var(--dc-text); font-size: 14.5px; }
.dc-embed__testo b { color: #fff; font-weight: 600; }
.dc-embed__piede { margin-top: 10px; color: var(--dc-muted); font-size: 12px; }
.dc-embed__mini {
  display: grid;
  flex: none;
  place-items: center;
  align-self: flex-start;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: rgb(242 181 68 / 0.14);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgb(242 181 68 / 0.3);
}
.dc-embed__mini .icona { width: 28px; height: 28px; stroke-width: 1.5; }

.dc-campi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; margin: 10px 0 0; }
.dc-campi dt { color: var(--dc-muted); font-size: 12px; font-weight: 600; }
.dc-campi dd { margin-top: 1px; color: #fff; font-family: var(--mono); font-size: 18px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* Barre a segmenti, come quelle che i bot fanno con i caratteri a blocchi */
.dc-barre { display: grid; gap: 6px; margin-top: 12px; }
.dc-barra { display: grid; grid-template-columns: minmax(0, 8.6em) minmax(0, 1fr) 2.2em; align-items: center; gap: 10px; font-size: 13px; }
.dc-barra__nome { overflow: hidden; color: var(--dc-text); white-space: nowrap; text-overflow: ellipsis; }
.dc-barra__segni { display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 2px; }
.dc-barra__segni i { height: 10px; border-radius: 2px; background: rgb(255 255 255 / 0.1); }
.dc-barra__segni i.on { background: var(--accent); }
.dc-barra--dietro .dc-barra__segni i.on { background: #8e97ad; }
.dc-barra__voti { color: #fff; font-family: var(--mono); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }

.dc-citazione {
  margin: 6px 0 0;
  padding: 2px 0 2px 12px;
  border-left: 4px solid rgb(255 255 255 / 0.22);
  border-radius: 2px;
  color: var(--dc-text);
  font-size: 14.5px;
}

.dc-volo { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 12px; }
.dc-volo b { color: #fff; font-family: var(--mono); font-size: 20px; font-weight: 500; letter-spacing: -0.03em; }
.dc-volo__linea { position: relative; height: 24px; }
.dc-volo__linea::before { content: ""; position: absolute; inset: 50% 0 auto; border-top: 2px dotted rgb(255 255 255 / 0.3); }
.dc-volo__fatto { position: absolute; inset: 50% auto auto 0; width: 62%; height: 2px; margin-top: -1px; border-radius: 2px; background: var(--accent); }
.dc-volo__linea .icona {
  position: absolute;
  top: 50%;
  left: 62%;
  width: 20px;
  height: 20px;
  color: var(--accent);
  fill: var(--dc-embed);
  transform: translate(-50%, -50%) rotate(90deg);
}

/* Pulsanti dei messaggi (nei link di Discord sono grigi, con la freccia che esce) */
.dc-bottoni { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dc-bottone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: #3b4152;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s;
}
.dc-bottone:hover { background: #4b5268; }
.dc-bottone .icona { width: 15px; height: 15px; opacity: 0.8; }

/* Comandi e campo di scrittura */
.dc__piede { margin-top: auto; padding-bottom: 16px; }
.dc__comandi {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 16px 0;
  border-top: 1px solid var(--dc-line);
}
.dc__comandi li { display: grid; gap: 2px; padding: 8px 10px; border-radius: 8px; background: var(--dc-embed); }
.dc__comandi b { color: var(--accent); font-family: var(--mono); font-size: 14px; font-weight: 500; }
.dc__comandi span { color: var(--dc-muted); font-size: 12.5px; line-height: 1.3; }
.dc__input {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  margin: 10px 16px 0;
  padding: 0 14px;
  border-radius: 8px;
  background: #2d3242;
  color: #a3abbf;
  font-size: 15px;
}
.dc__piu {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #a3abbf;
  color: #1f2330;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

/* Arrivo dei messaggi, uno dopo l'altro (solo con effetti pieni; discord.js mette data-anima) */
.mov-pieno .dc[data-anima] .dc-voce { opacity: 0; transform: translateY(10px); }
.mov-pieno .dc[data-anima] .dc-voce.is-arrivato {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), background-color 0.2s;
}

/* ---------- Cosa pubblica ---------- */

.bot-posta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bot-posta__testa { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bot-posta .riquadro > p:last-child { margin-top: auto; }
.bot-quando { background: var(--surface-3); color: var(--text-2); height: 24px; }
.bot-barra span { font-family: var(--mono); font-size: 20px; font-weight: 600; line-height: 1; }

/* ---------- Tre passi ---------- */

.bot-passi { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bot-passo__n {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgb(242 181 68 / 0.3);
  color: var(--accent-text);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
}
.bot-mini {
  margin-top: 8px;
  padding: 12px;
  border-radius: var(--r-m);
  background: var(--surface-2);
  outline: 1px solid var(--line);
  outline-offset: -1px;
}
.bot-mini__select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--surface);
  outline: 1px solid var(--line-strong);
  outline-offset: -1px;
  font-size: 14.5px;
  font-weight: 600;
}
.bot-mini__select span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bot-mini__permessi { list-style: none; display: grid; gap: 2px; margin-top: 8px; }
.bot-mini__permessi li { display: flex; align-items: flex-start; gap: 10px; padding: 6px 2px; color: var(--text-2); font-size: 14px; }
.bot-mini__permessi .icona { margin-top: 3px; color: var(--accent-text); }
.bot-mini__azione { display: flex; justify-content: flex-end; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.bot-mini__azione .btn { cursor: default; }
.bot-mini__canali { list-style: none; display: grid; gap: 4px; }
.bot-mini__canali li {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 14.5px;
}
.bot-mini__canali li span { color: var(--text-2); font-family: var(--mono); }
.bot-mini__canali li.is-scelto { background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgb(242 181 68 / 0.4); color: var(--text); font-weight: 600; }
.bot-mini__canali li.is-scelto .icona { margin-left: auto; color: var(--accent-text); }

.bot-opzioni {
  list-style: none;
  display: grid;
  margin-top: 8px;
  overflow: hidden;
  border-radius: var(--r-m);
  background: var(--surface-2);
  outline: 1px solid var(--line);
  outline-offset: -1px;
}
.bot-opzione {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 4px 12px;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
  font-weight: 500;
}
.bot-opzione:first-child { border-top: 0; }
.bot-opzione .interruttore { flex: none; gap: 10px; min-height: 44px; }
.bot-opzione .interruttore span { min-width: 2.2em; color: var(--text-2); font-family: var(--mono); font-size: 12px; font-weight: 500; }

/* ---------- Chiusura ---------- */

.bot-chiusura {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 40px;
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--r-xl);
  background:
    radial-gradient(80% 90% at 100% 0%, rgb(242 181 68 / 0.1), transparent 60%),
    var(--surface);
  outline: 1px solid rgb(242 181 68 / 0.25);
  outline-offset: -1px;
  box-shadow: var(--ombra-2);
}
.bot-chiusura h2 { font-size: clamp(26px, 3vw, 38px); letter-spacing: -0.035em; }
.bot-chiusura p { margin-top: 8px; max-width: 46ch; color: var(--text-2); }
.bot-chiusura .azioni { margin-top: 0; }

/* ---------- Misure intermedie e telefono ---------- */

@media (max-width: 1000px) {
  .bot-posta, .bot-passi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bot-passo:last-child { grid-column: 1 / -1; }
  .dc__comandi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .dc { grid-template-columns: 72px minmax(0, 1fr); }
  .dc__canali { display: none; }
}

@media (max-width: 640px) {
  .dc { grid-template-columns: minmax(0, 1fr); }
  .dc__rail { display: none; }
  .dc__testa { padding: 0 12px; }
  .dc-giorno { margin-inline: 12px; }
  .dc-mess { grid-template-columns: 36px minmax(0, 1fr); gap: 0 10px; padding: 8px 12px 10px; }
  .dc-avatar { width: 36px; height: 36px; }
  .dc-embed { padding: 10px 12px 12px 10px; }
  .dc-embed__mini { width: 44px; height: 44px; }
  .dc-embed__mini .icona { width: 22px; height: 22px; }
  .dc__comandi { padding-inline: 12px; }
  .dc__input { margin-inline: 12px; }
  .bot-posta, .bot-passi { grid-template-columns: minmax(0, 1fr); }
  .bot-passo:last-child { grid-column: auto; }
  .bot-chiusura .azioni .btn { width: 100%; }
}

@media (max-width: 480px) {
  .dc__comandi { grid-template-columns: repeat(4, max-content); gap: 6px; }
  .dc__comandi li { padding: 8px 10px; }
  .dc__comandi span { display: none; }
  /* il nome non si taglia: sta sopra la barra, con i voti a destra */
  .dc-barra { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; }
  .dc-barra__segni { grid-column: 1 / -1; grid-row: 2; }
  .dc-barre { gap: 10px; }
}

@media (max-width: 380px) {
  .dc__comandi { grid-template-columns: repeat(2, max-content); }
  .dc-campi { gap: 8px 10px; }
  .dc-campi dd { font-size: 17px; }
  .bot-scheda__corpo { padding-inline: 18px; }
}
