* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #282a63, #05030a);
  color: #f4eaff;
  min-height: 100vh;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* Header con titolo grande e sottotitolo piccolo e vicino */
.header {
  text-align: center;
  margin-bottom: 12px;
}

/* link che contiene titolo + sottotitolo (torna alla home) */
.header-title-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

.header h1 {
  letter-spacing: 0.24em;
  font-size: 2.4rem;        /* titolo grande */
  margin-bottom: 2px;
}

.subtitle {
  font-size: 0.6rem;        /* sottotitolo piccolo */
  color: #c4b3ff;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  margin-bottom: 8px;       /* vicino al titolo */
}

/* Banner di navigazione sotto il titolo (desktop) */
.nav-banner {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: radial-gradient(circle at top left, rgba(53, 34, 102, 0.95), rgba(10, 8, 32, 0.95));
  border: 1px solid rgba(190, 160, 255, 0.7);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.7);
}

.nav-link {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  text-decoration: none;
  color: #f7efff;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.nav-link:hover {
  border-color: rgba(235, 215, 255, 0.9);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

/* Sezioni principali una attaccata all'altra (niente gap extra) */
.main {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Box principale centrato */
.instructions {
  background: linear-gradient(135deg, rgba(37, 16, 74, 0.9), rgba(2, 9, 34, 0.9));
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(171, 140, 255, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  text-align: center;
  margin-bottom: 12px;
}

.instructions h2 {
  font-size: 1rem;
  margin: 0 0 6px 0;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #fdf5ff;
}

.instructions p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #e0d5ff;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Board: carta grande (solo dopo la scelta), ventaglio e bottone */
.board {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Contenitore della carta grande */
.big-card-container {
  display: none;
  justify-content: center;
  width: 100%;
  padding: 6px;
  border-radius: 16px;
  box-sizing: border-box;
  margin-bottom: 4px;
}

#big-card-image {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 2.5 / 4;
  border-radius: 16px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(220, 200, 255, 0.8);
  object-fit: cover;
}

/* Ventaglio di carte */
.cards-spread {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 180px;
  margin: 0 auto;
}

.card-slot {
  position: absolute;
  width: 70px;
  max-width: 14vw;
  aspect-ratio: 2.5 / 4;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(200, 180, 255, 0.6);
  background: radial-gradient(circle at top, #232146, #05020c);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.7);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.2s ease;
}

.card-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-slot:hover {
  transform: translate(-50%, -50%) translateY(-6px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.9);
  border-color: #f0e1ff;
}

/* Bottone Reset */
.btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(213, 190, 255, 0.8);
  background: radial-gradient(circle at top left, #4b2a8e, #0b0b2a);
  color: #f9f0ff;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.1s ease;
  margin-top: 2px;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Banner donazioni */
.donation {
  margin-top: 20px;
  background: linear-gradient(135deg, rgba(12, 8, 30, 0.95), rgba(38, 12, 70, 0.95));
  border-radius: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(190, 160, 255, 0.6);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.75);
  font-size: 0.85rem;
  line-height: 1.6;
  color: #e7ddff;
  text-align: center;
}

.donation p + p {
  margin-top: 10px;
}

.donation strong {
  color: #fdf1ff;
}

/* Link PayPal */
.donate-link {
  color: #fdf1ff;
  font-weight: 600;
  text-decoration: none;
}

.donate-link:hover {
  text-decoration: underline;
}

.footer {
  text-align: center;
  margin-top: 22px;
  font-size: 0.7rem;
  color: #9988cc;
}

/* Galleria */
.gallery-board {
  align-items: center;
  gap: 12px;
}

.gallery-big-card-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

#gallery-big-card-image {
  display: none;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 2.5 / 4;
  border-radius: 16px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(230, 210, 255, 0.9);
  object-fit: cover;
}

.gallery-grid {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}

.gallery-card {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(200, 180, 255, 0.7);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.7);
  background: radial-gradient(circle at top, #232146, #05020c);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.9);
  border-color: #f0e1ff;
}

/* Mobile */
@media (max-width: 800px) {
  .page {
    padding: 16px 10px 32px;
  }

  .header h1 {
    font-size: 1.8rem;
  }

  .subtitle {
    font-size: 0.55rem;
  }

  .nav-banner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 6px;
    column-gap: 6px;
    padding: 6px 10px;
  }

  .nav-link {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    padding: 3px 6px;
  }

  #big-card-image {
    max-width: 280px;
  }

  .cards-spread {
    height: 160px;
  }

  .card-slot {
    width: 60px;
  }

  #gallery-big-card-image {
    max-width: 320px;
  }
}

