/* Store di AlterEgo — stile dell'ecosistema GDR (alterego.it, rpg-database.com):
   testata blu notte, sfondo pergamena di AlterEgo, carte crema con bordo arancio,
   titoli in Cinzel. Nessuna risorsa esterna (CSP 'self'): font e texture sono qui. */

@font-face {
  font-family: "Cinzel";
  src: url("font/cinzel.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --notte: #1f293f;
  --notte-chiaro: #2d3a57;
  --pergamena: #f4f1e0;
  --crema: #fffaf0;
  --bordo: #e0d6bc;
  --arancio: #c87412;
  --marrone: #6b4f28;
  --marrone-scuro: #4d3319;
  --testo: #2b2620;
  --testo-tenue: #6f6556;
  --oro: #e0a526;
  --oro-scuro: #b8862b;
  --ok: #2e7d32;
  --errore: #b3402a;
  --raggio: 10px;
  --titoli: "Cinzel", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #d4d3bc url("sfondo.jpg");
  color: var(--testo);
  font: 16px/1.55 var(--sans);
}

a { color: #8a5a12; }
a:hover { color: var(--arancio); }

h1, h2, h3 { font-family: var(--titoli); font-weight: 700; color: var(--marrone); line-height: 1.25; }
h1 { font-size: 2rem; margin: 0 0 .6rem; }
h2 { font-size: 1.4rem; margin: 1.2rem 0 .5rem; }
h3 { font-size: 1.25rem; margin: 0 0 .3rem; }
small { color: var(--testo-tenue); font-size: .85em; }

/* Testata come alterego.it e rpg-database.com */
.testata {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: space-between;
  padding: .7rem 16px; background: var(--notte); color: var(--pergamena);
}
.marchio { display: flex; align-items: center; gap: .6rem; font-size: 1.45rem; color: var(--pergamena); text-decoration: none; }
.marchio img { height: 40px; width: auto; }
.marchio:hover { color: #fff; }
.testata nav { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; align-items: center; }
.testata nav a, .testata .link { color: var(--pergamena); text-decoration: none; font-size: .95rem; }
.testata nav a:hover, .testata .link:hover { color: var(--oro); }
.badge { background: var(--oro); color: var(--notte); border-radius: 999px; padding: 0 .45em; font-size: .8em; font-weight: bold; }

main { max-width: 1140px; margin: 0 auto; padding: 1.5rem 16px 2rem; }

.intro { text-align: center; padding: .5rem 0 .5rem; }
.intro h1 { font-size: 2.4rem; }
.intro p { color: var(--testo); }

.gruppo { margin-top: 1.8rem; }
.gruppo > h2 { text-align: center; font-size: 1.7rem; }
.gruppo > .nota { text-align: center; }
.griglia { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-top: 1rem; }

/* Carte come la vetrina di rpg-database.com */
.carta {
  background: var(--crema); border: 1px solid var(--bordo); border-top: 8px solid var(--arancio);
  border-radius: 4px; box-shadow: 0 2px 6px rgba(60, 45, 20, .12);
  display: flex; flex-direction: column; text-align: center;
}
.carta img {
  width: 220px; max-width: 80%; aspect-ratio: 1 / 1; object-fit: cover; display: block;
  margin: 20px auto 0; border-radius: 10px; box-shadow: 0 4px 10px rgba(0, 0, 0, .25);
}
.carta .corpo { padding: 14px 20px 20px; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.carta h3 { font-size: 1.6rem; font-weight: 400; }
.carta .corpo form, .carta .corpo > .bottone { margin-top: auto; }
.carta.spenta { opacity: .65; }
.prezzo { font-size: 1.35rem; color: var(--marrone-scuro); font-weight: 600; margin: 0; }
.prezzo s { color: var(--testo-tenue); font-size: .8em; font-weight: 400; margin-right: .3em; }
.effetti { margin: 0; padding: 0; list-style: none; font-size: .95rem; }
.effetti li { padding: .15rem 0; }
.effetti li::before { content: "✦ "; color: var(--arancio); }
.etichetta { margin: 0; font-size: .85rem; color: var(--errore); font-weight: 600; }
details summary { cursor: pointer; color: #8a5a12; }
.descrizione { font-size: .93rem; margin-top: .4rem; overflow-wrap: anywhere; }

.pannello {
  background: var(--crema); border: 1px solid var(--bordo); border-radius: var(--raggio);
  padding: 22px; margin-bottom: 20px; box-shadow: 0 2px 6px rgba(60, 45, 20, .10); overflow-x: auto;
}
.pannello.stretto { max-width: 580px; margin-left: auto; margin-right: auto; }

.bottone {
  display: inline-block; background: var(--oro); color: #2b1d07; border: 1px solid var(--oro-scuro); border-radius: 8px;
  padding: .6rem 1.2rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
}
.bottone:hover { background: #ecb43c; color: #2b1d07; }
.bottone:disabled { background: #d8d0bb; border-color: #c9bfa6; color: #8a8170; cursor: not-allowed; }
.bottone.secondario { background: var(--notte); border-color: var(--notte); color: var(--pergamena); }
.bottone.secondario:hover { background: var(--notte-chiaro); }
.bottone.pericolo { background: var(--errore); border-color: #8e2f1e; color: #fff; }
.bottone.piccolo { padding: .3rem .7rem; font-size: .9rem; }
.link { background: none; border: 0; color: #8a5a12; font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.in-linea { display: inline; }

.modulo { display: flex; flex-direction: column; gap: .9rem; max-width: 660px; }
.modulo label { display: flex; flex-direction: column; gap: .3rem; font-weight: 500; }
.modulo label.spunta { flex-direction: row; align-items: flex-start; gap: .55rem; font-weight: 400; }
.modulo label.spunta input { margin-top: .3rem; flex: none; }
input, select, textarea {
  background: #fff; color: var(--testo); border: 1px solid #cfc3a3; border-radius: 6px;
  padding: .5rem .6rem; font: inherit; font-weight: 400; max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--oro); border-color: var(--oro-scuro); }
.corto { width: 7rem; }
fieldset { border: 1px solid var(--bordo); border-radius: 8px; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .7rem; background: #fff; }
legend { font-family: var(--titoli); color: var(--marrone); padding: 0 .3rem; }

.tabella { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; font-size: .95rem; }
.tabella th, .tabella td { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--bordo); vertical-align: top; }
.tabella thead th { color: var(--marrone); }
.tabella tfoot th { color: var(--marrone-scuro); }

.avviso { border-radius: 8px; padding: .7rem .9rem; margin: 0 0 1rem; }
.avviso-ok { background: #e6f2e2; border: 1px solid #a7cf9e; }
.avviso-errore { background: #f9e3dd; border: 1px solid #e3a796; }
.nota { color: var(--testo-tenue); font-size: .92rem; }
.stato { font-weight: 600; }
.stato-pagato { color: var(--ok); }
.stato-fallito, .stato-scaduto, .stato-annullato { color: var(--errore); }
.stato-in_pagamento { color: #8a5a12; }
.ordine { border-top: 1px solid var(--bordo); padding-top: .6rem; }
.ordine ul { padding-left: 1.1rem; }
.ordine li a { margin-left: .4rem; }
.azioni { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; }
.compito { border-top: 1px solid var(--bordo); padding: .6rem 0; }
code { color: var(--testo-tenue); overflow-wrap: anywhere; }

.piede { background: var(--notte); color: #cfd3dc; padding: 1.3rem 16px 2rem; text-align: center; font-size: .85rem; }
.piede a { color: var(--pergamena); }
.piede p { margin: .3rem 0; }
.societa { max-width: 780px; margin: .6rem auto 0 !important; color: #aab0bd; }

@media (max-width: 600px) {
  h1, .intro h1 { font-size: 1.6rem; }
  .marchio { font-size: 1.2rem; }
  .tabella { font-size: .88rem; }
}

.carta .corpo .bottone { width: 100%; }
.pannello > h1:first-child, .pannello > h2:first-child { margin-top: 0; }
.bonifico { background: #fff; border: 1px solid var(--bordo); border-left: 6px solid var(--arancio); border-radius: 6px; padding: .8rem 1rem; }
.bonifico dt { font-weight: 600; color: var(--marrone); }
.bonifico dd { margin: 0 0 .5rem; font-family: ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
