/* =========================================================
   VARIABLES & RESET (Coerenti con il Brand)
   ========================================================= */
:root {
  --bg: #faf8f5;
  --text: #1f1f1f;
  --muted: #6b6b6b;
  --accent: #b89b7a;
  --white: #fff;
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding: 80px 20px;
}

/* =========================================================
   LAYOUT CONTAINER
   ========================================================= */
.rules-container {
  max-width: 750px;
  margin: 0 auto;
  background: var(--white);
  padding: 50px 60px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.03);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.02);
}

/* =========================================================
   HEADER SECTION
   ========================================================= */
.rules-header {
  text-align: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding-bottom: 30px;
  margin-bottom: 40px;
}

.rules-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  color: var(--text);
  margin-bottom: 10px;
}

.rules-subtitle {
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.5px;
}

/* =========================================================
   CONTENT SECTIONS (Paragrafi del regolamento)
   ========================================================= */
.rules-content {
  display: flex;
  flex-direction: column;
  gap: 40px; /* Aumentato leggermente lo spazio tra le lingue */
}

.rules-section {
  padding-bottom: 10px;
}

/* Contenitore per allineare Bandiera e Titolo sulla stessa riga */
.lang-title-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

/* Stile della bandierina tonda */
.flag-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); /* Una leggera ombra per far risaltare il bianco */
  border-radius: 50%;
}

.rules-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--text);
  margin-bottom: 0; /* Lasciamo che lo spazio lo gestisca il wrapper */
}

.rules-section p {
  color: var(--muted);
  font-size: 15px;
  text-align: justify;
  padding-left: 42px; /* Allinea perfettamente il blocco di testo sotto il titolo saltando la bandiera */
}

/* =========================================================
   FOOTER & BACK BUTTON
   ========================================================= */
.rules-footer {
  text-align: center;
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.rules-footer p {
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 24px;
}

.back-btn {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity var(--transition-smooth);
}

.back-btn:hover {
  opacity: 0.9;
}

/* =========================================================
   RESPONSIVE OPTIMIZATION (Mobile Smartphones)
   ========================================================= */
@media (max-width: 768px) {
  body {
    padding: 30px 15px;
  }

  .rules-container {
    padding: 30px 24px;
    border-radius: 12px;
  }

  .rules-header h1 {
    font-size: 28px;
  }

  .rules-header {
    padding-bottom: 20px;
    margin-bottom: 25px;
  }

  .rules-section h2 {
    font-size: 18px;
  }
  
  .rules-section p {
    padding-left: 0; /* Su mobile rimuoviamo il rientro per sfruttare tutto lo schermo */
    text-align: left;
  }
  
}