body {
  margin: 0;
  font-family: Roboto, Arial, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
}

.main-layout {
  min-height: 100vh;
  padding: 1rem 2rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.grid-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.panel {
  border: 1px solid #c9a84c;
  padding: 1rem;
  border-radius: 0.5rem;
  background: rgba(255,255,255,0.03);
}

a {
  color: #c9a84c;
}

.auth-card {
  max-width: 28rem;
  margin: 0 auto 1rem;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.auth-card input {
  padding: 0.5rem;
  border: 1px solid #c9a84c;
  border-radius: 0.25rem;
  background: #16213e;
  color: #e0e0e0;
}

.auth-card button {
  margin-top: 0.5rem;
  padding: 0.6rem;
  border: 0;
  border-radius: 0.25rem;
  background: #c9a84c;
  color: #1a1a2e;
  font-weight: bold;
  cursor: pointer;
}

.form-error {
  color: #ff8a80;
}

.form-ok {
  color: #a5d6a7;
}

.subnav {
  margin-bottom: 1rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-family: Cinzel, serif;
  font-size: 2rem;
  color: #c9a84c;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.data-table th,
.data-table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid rgba(201, 168, 76, 0.3);
  text-align: left;
}

.row-disabled {
  opacity: 0.55;
}

.status-up {
  color: #a5d6a7;
}

.status-down {
  color: #ff8a80;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.inline-form textarea {
  flex: 1 1 14rem;
  min-height: 2.4rem;
  max-height: 14rem;
  resize: vertical;
  font: inherit;
}

.inline-form input,
.inline-form textarea,
.data-table input {
  padding: 0.35rem 0.5rem;
  border: 1px solid #c9a84c;
  border-radius: 0.25rem;
  background: #16213e;
  color: #e0e0e0;
}

.btn-small {
  padding: 0.3rem 0.7rem;
  border: 1px solid #c9a84c;
  border-radius: 0.25rem;
  background: transparent;
  color: #c9a84c;
  cursor: pointer;
}

.btn-small:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.hint {
  font-size: 0.85rem;
  opacity: 0.7;
}

.actions {
  white-space: nowrap;
}

.json-view {
  max-height: 24rem;
  overflow: auto;
  padding: 0.75rem;
  border: 1px solid rgba(201, 168, 76, 0.4);
  border-radius: 0.25rem;
  background: #16213e;
  white-space: pre-wrap;
}

select {
  padding: 0.35rem 0.5rem;
  border: 1px solid #c9a84c;
  border-radius: 0.25rem;
  background: #16213e;
  color: #e0e0e0;
}

.btn-link {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border: 1px solid #c9a84c;
  border-radius: 0.25rem;
  color: #c9a84c;
  text-decoration: none;
}

.actions > * {
  margin-right: 0.4rem;
}

/* Schermata di gioco */
.play-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.play-main,
.play-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-log {
  height: 24rem;
  overflow-y: auto;
  padding: 0.5rem;
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 0.25rem;
  background: #16213e;
}

.chat-log-small {
  height: 9rem;
}

.entry-text {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.entry {
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.entry-author {
  margin-right: 0.4rem;
  font-weight: bold;
}

.entry-action .entry-author {
  color: #e0e0e0;
}

.entry-narration {
  color: #c9a84c;
  font-style: italic;
}

.entry-system {
  color: #9aa0b4;
  font-size: 0.85rem;
}

.entry-ooc {
  color: #8ab4f8;
}

.entry-dm-domanda {
  color: #e0e0e0;
}

.entry-dm-risposta {
  color: #c9a84c;
}

.chat-dm summary {
  cursor: pointer;
}

.ooc-tag {
  font-size: 0.75rem;
}

.chat-narrativa h3,
.pannello-azioni h3,
.scheda-personaggio h3 {
  margin-top: 0;
}

.pannello-azioni input,
.chat-ooc input {
  flex: 1;
  min-width: 10rem;
  padding: 0.45rem;
  border: 1px solid #c9a84c;
  border-radius: 0.25rem;
  background: #16213e;
  color: #e0e0e0;
}

.pannello-azioni input:disabled {
  opacity: 0.5;
}

.presence {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.presence-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.dot-online {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #4caf50;
}

.hp-bar {
  height: 0.8rem;
  margin: 0.4rem 0;
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.hp-fill {
  height: 100%;
  transition: width 0.4s ease;
}

.hp-ok {
  background: #4caf50;
}

.hp-warn {
  background: #e6b800;
}

.hp-low {
  background: #e53935;
}

.stat-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

.stat-table th,
.stat-table td {
  padding: 0.25rem;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .play-grid {
    grid-template-columns: 1fr;
  }
}

/* Ciclo di vita della sessione */
.session-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1rem;
}

.session-banner {
  margin: 0 0 1rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid #c9a84c;
  border-left-width: 0.35rem;
  border-radius: 0.25rem;
  background: rgba(201, 168, 76, 0.08);
}

.btn-danger {
  border-color: #e57373;
  color: #e57373;
}

/* Riepilogo: il log si legge dall'alto, senza la finestra a scorrimento della chat */
.riepilogo-log {
  padding: 0.75rem;
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 0.25rem;
  background: #16213e;
}

.summary-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 2rem;
  margin: 0 0 1rem;
}

/* Dadi e gruppo */
.entry-roll {
  padding: 0.25rem 0.5rem;
  border-left: 0.25rem solid #8ab4f8;
  background: rgba(138, 180, 248, 0.07);
  color: #cfd8f0;
  font-size: 0.9rem;
}

.entry-roll .entry-author::before {
  content: "🎲 ";
}

/* Una prova a colpire o contro una CD: prima l'esito (grande, verde o rosso), poi i danni, il tiro e la difficoltà */
.roll-head {
  font-size: 0.85rem;
  color: #9aa0b4;
}

.roll-verdict {
  margin: 0.1rem 0;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.04em;
  font-variant-caps: all-small-caps;
}

.roll-verdict.roll-ok {
  color: #3ddc84;
}

.roll-verdict.roll-ko {
  color: #ff5d5d;
}

.roll-verdict.roll-crit {
  text-shadow: 0 0 0.6rem currentColor;
}

.roll-damage {
  font-size: 1.15rem;
  color: #f0e6c8;
}

.roll-effect,
.roll-detail,
.roll-note {
  font-size: 0.85rem;
  color: #9aa0b4;
}

.roll-numbers {
  font-size: 1rem;
}

.roll-total {
  font-size: 1.15rem;
  color: #e8ecf8;
}

.roll-dc {
  font-size: 0.95rem;
  color: #cfd8f0;
}

.gruppo-lista {
  margin: 0;
  padding: 0;
  list-style: none;
}

.gruppo-membro {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.1rem 0.75rem;
  margin: 0 0 0.6rem;
}

.gruppo-membro .hp-bar {
  grid-column: 1 / -1;
  margin: 0.1rem 0 0;
}

.hp-bar-small {
  height: 0.45rem;
}

.gruppo-pf {
  font-size: 0.85rem;
}

/* Combattimento */
.pannello-combattimento h3 {
  margin-top: 0;
}

.turno-corrente {
  margin: 0 0 0.6rem;
}

.turno-mio {
  padding: 0.35rem 0.6rem;
  border-left: 0.3rem solid #4caf50;
  background: rgba(76, 175, 80, 0.12);
}

.iniziativa {
  margin: 0 0 0.6rem;
  padding: 0;
  list-style: none;
}

.combattente {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.1rem 0.6rem;
  align-items: center;
  margin: 0 0 0.45rem;
  padding: 0.2rem 0.4rem;
  border-left: 0.25rem solid transparent;
}

.combattente.is-current {
  border-left-color: #c9a84c;
  background: rgba(201, 168, 76, 0.1);
}

.combattente.nemico .nome {
  color: #e57373;
}

.combattente.fuori {
  opacity: 0.45;
  text-decoration: line-through;
}

.combattente .ini {
  font-size: 0.8rem;
  opacity: 0.7;
  text-align: center;
}

.combattente .stato {
  font-size: 0.85rem;
}

.combattente .hp-bar {
  grid-column: 2 / -1;
  margin: 0;
}

.story-hook {
  margin: 0.75rem 0 0;
  padding: 0.5rem 1rem;
  border-left: 3px solid #c9a84c;
  background: rgba(201, 168, 76, 0.08);
}

.story-hook h3 {
  margin: 0 0 0.25rem;
}

.skeleton-panel textarea {
  width: 100%;
  min-height: 4rem;
  padding: 0.5rem;
  border: 1px solid #c9a84c;
  border-radius: 0.25rem;
  background: #16213e;
  color: #e0e0e0;
  font: inherit;
}

.version-footer {
  margin: 2rem 0 0.5rem;
  font-size: 0.75rem;
  opacity: 0.55;
  text-align: right;
}

.badge-ia {
  margin-left: 0.4rem;
  padding: 0 0.35rem;
  border: 1px solid #c9a84c;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  color: #c9a84c;
}

.badge-assente {
  margin-left: 0.4rem;
  padding: 0 0.35rem;
  border: 1px solid #8a8a8a;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  color: #8a8a8a;
}

.gruppo-assente .gruppo-nome,
.gruppo-assente .gruppo-pf {
  opacity: 0.6;
}

/* Scheda in partita: sezioni, competenze, mosse con vignetta */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.scheda-tabs {
  display: flex;
  gap: 0.25rem;
  margin: 0.5rem 0;
  flex-wrap: wrap;
}

.scheda-tab {
  padding: 0.2rem 0.6rem;
  border: 1px solid #c9a84c;
  border-radius: 0.25rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.scheda-tab.attiva {
  background: #c9a84c;
  color: #1b1b1b;
}

.scheda-personaggio h4 {
  margin: 0.8rem 0 0.3rem;
  font-size: 0.9rem;
}

.competenze,
.mosse,
.equipaggiamento {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}

.competenze-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.1rem 0.75rem;
}

.comp-no {
  opacity: 0.75;
}

.comp-si .pallino {
  color: #c9a84c;
}

.mosse li,
.equipaggiamento li {
  position: relative;
  margin: 0 0 0.25rem;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
}

.mossa {
  cursor: help;
}

.mossa:hover,
.mossa:focus {
  background: rgba(201, 168, 76, 0.12);
  outline: none;
}

.mossa-nome {
  font-weight: 600;
}

.tipo-mossa {
  margin-left: 0.3rem;
  padding: 0 0.3rem;
  border: 1px solid #8a8a8a;
  border-radius: 0.25rem;
  font-size: 0.65rem;
  color: #a8a8a8;
  white-space: nowrap;
}

.tipo-auto {
  border-color: #c9a84c;
  color: #c9a84c;
}

.vignetta {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 20;
  margin-top: 0.15rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #c9a84c;
  border-radius: 0.4rem;
  background: #1f1d19;
  box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.55);
  font-size: 0.82rem;
  line-height: 1.35;
}

/* Con la tastiera la vignetta si apre anche quando il focus è su un pulsante dentro l'oggetto (:focus-visible); un clic col mouse su quel pulsante non la tiene aperta
   (con :focus-within resterebbe sopra gli oggetti sotto e ne coprirebbe i pulsanti). */
.mossa:hover .vignetta,
.mossa:focus .vignetta,
.mossa:has(:focus-visible) .vignetta {
  display: block;
}

.vignetta-testo,
.vignetta-stat {
  display: block;
  margin: 0.3rem 0;
}

.vignetta-stat span {
  display: block;
  color: #c9a84c;
}

/* Inventario: la descrizione si apre con un clic sull'oggetto e sta nel flusso della pagina (spinge in basso gli oggetti successivi, non li copre) */
.oggetto-riga {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

.oggetto-titolo {
  flex: 1 1 auto;
  cursor: pointer;
}

.oggetto:hover {
  background: rgba(201, 168, 76, 0.12);
}

.oggetto-titolo:focus-visible {
  outline: 1px solid #c9a84c;
  outline-offset: 2px;
}

.oggetto-freccia {
  display: inline-block;
  width: 1em;
  color: #c9a84c;
}

.descrizione-oggetto {
  margin: 0.2rem 0 0.1rem 1rem;
  padding: 0.1rem 0 0.1rem 0.6rem;
  border-left: 2px solid rgba(201, 168, 76, 0.6);
  font-size: 0.8rem;
  line-height: 1.35;
  color: #c4c4c4;
}

/* Blocco 26: pulsanti e avvisi degli oggetti (indossa, impugna, bevi) */
.azione-oggetto {
  margin-left: 0.5rem;
  padding: 0 0.5rem;
  font-size: 0.72rem;
}

.avviso-oggetto {
  display: block;
  margin: 0.3rem 0;
  color: #ffb74d;
}

/* Colori del racconto: un colore per personaggio, rosso per i nemici */
.pg-0 { --c: #4fc3f7; }
.pg-1 { --c: #81c784; }
.pg-2 { --c: #ba68c8; }
.pg-3 { --c: #f06292; }
.pg-4 { --c: #4db6ac; }
.pg-5 { --c: #b9a08a; }
.pg-6 { --c: #7986cb; }
.pg-7 { --c: #aed581; }
.nemico { --c: #ff6b6b; }

.nome {
  color: var(--c);
  font-weight: 600;
}

.entry-action[class*="pg-"],
.entry-action.nemico {
  padding: 0.3rem 0.5rem;
  border-left: 0.25rem solid var(--c);
  border-radius: 0.2rem;
  background: color-mix(in srgb, var(--c) 12%, transparent);
}

.entry-roll[class*="pg-"],
.entry-roll.nemico {
  border-left-color: var(--c);
  background: color-mix(in srgb, var(--c) 8%, transparent);
}

.entry-narration {
  padding-left: 0.5rem;
  border-left: 0.25rem solid rgba(201, 168, 76, 0.45);
}

.legenda-colori {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
}

.entry-action .entry-author.nome {
  color: var(--c);
}

/* Versione ben visibile nella pagina di accesso */
.versione-login {
  margin: 0;
  padding: 0.15rem 0.7rem;
  border: 1px solid #c9a84c;
  border-radius: 1rem;
  color: #c9a84c;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}

.quantita{color:#c9a84c;font-weight:600}

/* Storico delle sessioni (Blocco 28): menu delle sessioni a sinistra, riepilogo a destra (sotto, sul telefono) */
.storico {
  display: grid;
  grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.storico-menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.storico-voce {
  display: block;
  width: 100%;
  margin: 0 0 0.3rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid #5a5a5a;
  border-radius: 0.3rem;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.storico-voce:hover,
.storico-voce:focus-visible {
  border-color: #c9a84c;
}

.storico-voce.attiva {
  border-color: #c9a84c;
  background: rgba(201, 168, 76, 0.15);
  font-weight: 600;
}

.storico-testo {
  white-space: pre-wrap;
  line-height: 1.45;
}

@media (max-width: 40rem) {
  .storico {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---- creazione guidata del personaggio ---- */
.creazione-intro {
  max-width: 62rem;
  margin: 0 0 1rem;
  color: #b8bdd0;
}

.creazione {
  max-width: 62rem;
  padding: 1.2rem 1.4rem 0;
  border-radius: 0.8rem;
  background: linear-gradient(180deg, rgba(201, 168, 76, 0.06), rgba(255, 255, 255, 0.02) 14rem);
}

/* Creazione a caso: un riquadro a parte, in alto */
.creazione-strumenti {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.4rem;
  padding: 0.8rem 1rem;
  border: 1px dashed rgba(201, 168, 76, 0.65);
  border-radius: 0.6rem;
  background: rgba(201, 168, 76, 0.07);
}

.creazione-strumenti-testo {
  display: flex;
  flex-direction: column;
  flex: 1 1 22rem;
  gap: 0.15rem;
  font-size: 0.88rem;
  color: #b8bdd0;
}

.creazione-strumenti-testo strong {
  font-size: 1rem;
  color: #e8dcae;
}

.creazione-strumenti-azioni {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.creazione .btn-small,
.creazione-nav .btn-small {
  padding: 0.5rem 1rem;
  border-radius: 0.4rem;
  font-weight: 600;
}

.creazione .btn-primary,
.btn-primary {
  border: 1px solid #c9a84c;
  border-radius: 0.4rem;
  background: #c9a84c;
  color: #1a1a2e;
  font-weight: 700;
  cursor: pointer;
}

.creazione button.btn-primary {
  padding: 0.55rem 1.2rem;
}

.creazione .btn-primary:hover:not(:disabled) {
  background: #dcbc5e;
}

.creazione .btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Indicatore dei passi: cerchi numerati uniti da una linea */
.creazione-passi {
  display: flex;
  gap: 0;
  margin: 0 0 1.4rem;
  padding-bottom: 0.3rem;
  overflow-x: auto;
}

.creazione-passi .passo {
  position: relative;
  display: flex;
  flex: 1 0 5.4rem;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.2rem;
  border: 0;
  background: transparent;
  color: #9aa0b4;
  font-size: 0.82rem;
  text-align: center;
  cursor: pointer;
}

.creazione-passi .passo::before {
  content: "";
  position: absolute;
  top: 1.05rem;
  right: 50%;
  left: -50%;
  height: 2px;
  background: #3a4160;
}

.creazione-passi .passo:first-child::before {
  display: none;
}

.creazione-passi .passo.completo::before,
.creazione-passi .passo.attivo::before {
  background: #81c784;
}

.passo-num {
  position: relative;
  z-index: 1;
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border: 2px solid #3a4160;
  border-radius: 50%;
  background: #1a1a2e;
  font-weight: 700;
  color: #cfd3e4;
}

.creazione-passi .passo:hover .passo-num {
  border-color: #c9a84c;
}

.creazione-passi .passo.completo .passo-num {
  border-color: #81c784;
  background: #81c784;
  color: #10231a;
}

.creazione-passi .passo.attivo .passo-num {
  border-color: #c9a84c;
  background: #c9a84c;
  color: #1a1a2e;
  box-shadow: 0 0 0 0.25rem rgba(201, 168, 76, 0.25);
}

.creazione-passi .passo.attivo {
  color: #f1e7c4;
  font-weight: 700;
}

.creazione-passi .passo.completo:not(.attivo) {
  color: #c4e2c6;
}

/* Titolo del passo */
.creazione h2 {
  display: flex;
  align-items: center;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(201, 168, 76, 0.4);
  font-size: 1.4rem;
  color: #f1e7c4;
}

.creazione h3 {
  margin: 1.2rem 0 0.4rem;
  font-size: 1.05rem;
  color: #e8dcae;
}

/* Campi */
.creazione .campo {
  display: grid;
  grid-template-columns: minmax(10rem, 13rem) minmax(0, 1fr);
  gap: 0.3rem 1rem;
  align-items: center;
  margin: 0.8rem 0;
}

.creazione .campo > label {
  font-weight: 600;
  color: #dcd6bd;
}

.creazione .campo > .hint {
  grid-column: 2;
}

.creazione .campo input[type="text"],
.creazione .campo select,
.creazione .campo textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(201, 168, 76, 0.55);
  border-radius: 0.4rem;
  background: #111a33;
  color: #e8ebf5;
  font: inherit;
}

.creazione .campo textarea {
  resize: vertical;
}

.creazione .campo input:focus,
.creazione .campo select:focus,
.creazione .campo textarea:focus {
  outline: 2px solid rgba(201, 168, 76, 0.55);
  outline-offset: 1px;
}

.creazione .campo #nome-a-caso {
  grid-column: 2;
  justify-self: start;
}

/* Schede informative (classe, background, specie, riepilogo) */
.scheda-classe {
  margin: 0.8rem 0 1.1rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-left: 0.3rem solid #c9a84c;
  border-radius: 0.5rem;
  background: rgba(17, 26, 51, 0.7);
}

.scheda-classe > p:first-child {
  margin-top: 0;
}

.scheda-classe .dati {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 0.4rem 1rem;
  margin: 0.6rem 0;
  padding: 0;
  list-style: none;
}

.scheda-classe .dati li {
  padding: 0.35rem 0.6rem;
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.92rem;
}

.scheda-classe .dati li strong {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c9a84c;
}

.scheda-classe h3 {
  margin: 0.9rem 0 0.4rem;
  font-size: 1rem;
}

.privilegio {
  margin: 0.25rem 0;
  padding: 0.35rem 0.7rem;
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.04);
}

.privilegio summary {
  cursor: pointer;
  font-weight: 600;
}

.privilegio p {
  margin: 0.4rem 0 0.2rem;
  font-size: 0.92rem;
  color: #c6cbdc;
}

/* Il riepilogo finale come una scheda */
.scheda-classe[data-info="riepilogo"] {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.12), rgba(17, 26, 51, 0.85));
}

.scheda-classe[data-info="riepilogo"] > p:first-child {
  font-size: 1.1rem;
}

/* Scelte del regolamento: una scheda per scelta, opzioni da toccare */
.scelta {
  margin: 1rem 0;
  padding: 0.7rem 1rem 1rem;
  border: 1px solid #3a4160;
  border-radius: 0.6rem;
  background: rgba(17, 26, 51, 0.45);
}

.scelta.scelta-aperta {
  border-color: #e0a64c;
}

.scelta.scelta-fatta {
  border-color: #81c784;
}

.scelta legend {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.5rem;
  font-weight: 700;
  color: #f1e7c4;
}

.scelta-conta {
  padding: 0.05rem 0.55rem;
  border-radius: 1rem;
  background: rgba(224, 166, 76, 0.2);
  font-size: 0.78rem;
  font-weight: 700;
  color: #f0c27a;
}

.scelta.scelta-fatta .scelta-conta {
  background: rgba(129, 199, 132, 0.2);
  color: #9be0a0;
}

.scelta > .hint {
  margin: 0.2rem 0 0.6rem;
}

.opzioni {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.5rem 0.7rem;
}

.opzioni.opzioni-lunghe {
  max-height: 24rem;
  overflow-y: auto;
  padding-right: 0.4rem;
}

.opzione {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.55rem;
  align-items: start;
  padding: 0.5rem 0.7rem;
  border: 1px solid #3a4160;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.opzione input {
  margin: 0.2rem 0 0;
  accent-color: #c9a84c;
}

.opzione-nome {
  font-weight: 600;
}

.opzione:hover {
  border-color: #c9a84c;
  background: rgba(201, 168, 76, 0.07);
}

.opzione.opzione-attiva {
  border-color: #c9a84c;
  background: rgba(201, 168, 76, 0.18);
  box-shadow: inset 0 0 0 1px rgba(201, 168, 76, 0.5);
}

.opzione.opzione-attiva .opzione-nome {
  color: #f6e9b8;
}

.opzione-desc {
  grid-column: 2;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #aeb4c8;
}

/* Caratteristiche: sei schede con il modificatore in grande */
.creazione-punteggi,
.creazione-punteggi tbody {
  display: block;
}

.creazione-punteggi {
  margin: 0.8rem 0;
}

.creazione-punteggi thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.creazione-punteggi tbody {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.8rem;
}

.creazione-punteggi tr {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.2rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(201, 168, 76, 0.4);
  border-radius: 0.6rem;
  background: rgba(17, 26, 51, 0.7);
}

.creazione-punteggi td {
  padding: 0;
  font-size: 0.95rem;
  text-align: center;
}

.creazione-punteggi td.nome-caratteristica,
.creazione-punteggi td.controllo-punteggio {
  grid-column: 1 / -1;
}

.creazione-punteggi td.nome-caratteristica {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #c9a84c;
}

.creazione-punteggi td.controllo-punteggio {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
  margin: 0.2rem 0 0.4rem;
}

.creazione-punteggi td.controllo-punteggio select {
  min-width: 5rem;
  font-size: 1.1rem;
  text-align: center;
}

.creazione-punteggi td.controllo-punteggio .btn-small {
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
}

.creazione-punteggi td[data-etichetta]::before {
  content: attr(data-etichetta);
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8f96ad;
}

.creazione-punteggi td .punteggio {
  display: inline-block;
  min-width: 2.6rem;
  font-size: 1.7rem;
  font-weight: 800;
  text-align: center;
  color: #f1e7c4;
}

.creazione-punteggi td.modificatore {
  font-size: 1.15rem;
  font-weight: 800;
  color: #81c784;
}

/* Avanti e indietro restano a portata di mano */
.creazione-nav {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 1.4rem -1.4rem 0;
  padding: 0.8rem 1.4rem;
  border-top: 1px solid rgba(201, 168, 76, 0.35);
  border-radius: 0 0 0.8rem 0.8rem;
  background: rgba(22, 26, 48, 0.96);
}

@media (max-width: 40rem) {
  .creazione {
    padding: 0.9rem 0.8rem 0;
  }

  .creazione .campo {
    grid-template-columns: minmax(0, 1fr);
  }

  .creazione .campo > .hint,
  .creazione .campo #nome-a-caso {
    grid-column: 1;
  }

  .creazione-nav {
    margin: 1.2rem -0.8rem 0;
    padding: 0.7rem 0.8rem;
  }

  .creazione-passi .passo {
    flex-basis: 4.6rem;
    font-size: 0.74rem;
  }
}

/* ---- scheda: tratti e incantesimi (Blocco 16) ---- */
.incantesimo {
  margin: 0.2rem 0;
}

.incantesimo summary {
  cursor: pointer;
}

.incantesimo .tipo-mossa {
  margin-left: 0.3rem;
}

.incantesimo-testo {
  display: block;
  margin: 0.2rem 0 0.4rem 1rem;
  font-size: 0.88rem;
}

/* Missioni (Blocco 29) */
.missioni summary { cursor: pointer; }
.missioni h3 { margin: 0.9rem 0 0.3rem; font-size: 1rem; color: #c9a84c; }
.missioni-novita { color: #3ddc84; font-weight: 600; }
.missioni-avviso { margin: 0.4rem 0; padding: 0.4rem 0.6rem; border-left: 3px solid #3ddc84; background: rgba(61, 220, 132, 0.08); }
.missioni-elenco { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.missione { border: 1px solid #2c3a63; border-radius: 6px; padding: 0.5rem 0.7rem; background: rgba(255, 255, 255, 0.02); }
.missione-testa { display: flex; flex-wrap: wrap; gap: 0.4rem 0.6rem; align-items: baseline; }
.missione-titolo { font-weight: 600; }
.missione-tipo { font-size: 0.8rem; opacity: 0.75; }
.missione-stato { margin-left: auto; font-size: 0.8rem; padding: 0.05rem 0.5rem; border-radius: 999px; border: 1px solid #2c3a63; }
.missione-stato-attiva { color: #c9a84c; border-color: #c9a84c; }
.missione-stato-completata { color: #3ddc84; border-color: #3ddc84; }
.missione-stato-fallita { color: #ff5d5d; border-color: #ff5d5d; }
.missione-completata, .missione-fallita { opacity: 0.75; }
.missione-descrizione, .missione-esito, .missione-condivisione { margin: 0.3rem 0 0; }
.missione-condivisione { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
