/* ==========================================================
   Pizza-Doom - Global styles
   File: /var/www/html/styles.css
   ========================================================== */

:root {
  --header-h: 0px;

  --bg-dark: #070a0f;
  --text-dark: #222;
  --text-muted: #555;

  --blue: #004dff;
  --link: #007acc;
  --link-hover: #33b5ff;

  --card-bg: rgba(247, 247, 247, 0.96);
  --card-border: rgba(255, 255, 255, 0.55);
  --card-radius: 12px;
  --card-shadow:
    0 18px 45px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

html {
  background: var(--bg-dark);
}

/* Sfondo sfocato globale dietro tutta la pagina */
html::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;

  background-image: url("/assets/background.png");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;

  filter: blur(4px) saturate(1.15) brightness(0.72);
  transform: scale(1.08);
}

/* Overlay/vignetta globale */
html::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;

  background:
    radial-gradient(circle at center top, rgba(255, 95, 20, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.72));
}

body {
  margin: 0;
  padding-top: var(--header-h);

  min-height: 100vh;
  display: flex;
  flex-direction: column;

  font-family: Arial, Helvetica, sans-serif;
  color: var(--text-dark);
  background: transparent;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

.page {
  width: 100%;
  flex: 1 0 auto;
}

/* ==========================================================
   HERO - Home page
   ========================================================== */

.hero {
  position: relative;
  isolation: isolate;

  min-height: clamp(480px, 62vh, 690px);
  margin: 0;
  padding: 58px 20px 92px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: #fff;
  text-align: center;

  overflow: hidden;
}

/* Immagine nitida principale della hero */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;

  background-image: url("/assets/background.png");
  background-size: min(100vw, 1672px) auto;
  background-position: center top;
  background-repeat: no-repeat;
}

/* Overlay sopra hero per leggibilità */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;

  background:
    radial-gradient(circle at center, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.42) 66%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.20), rgba(0, 0, 0, 0.42) 68%, var(--bg-dark) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;

  width: min(520px, calc(100% - 40px));
  max-width: 520px;
  padding: 28px 28px 26px;

  background:
    linear-gradient(180deg, rgba(34, 10, 0, 0.84), rgba(16, 5, 0, 0.78));

  border: 1px solid rgba(255, 177, 74, 0.18);
  border-radius: 18px;

  backdrop-filter: blur(8px);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hero-title,
.hero h1 {
  margin: 0 0 8px;
  line-height: 1.05;
  font-size: clamp(2rem, 3vw, 3em);
}

.hero-logo {
  display: block;
  width: min(230px, 70vw);
  height: auto;
  margin: 0 auto 16px;
}

.hero p {
  max-width: 440px;
  margin: 0 auto;
  font-size: clamp(1rem, 1.25vw, 1.2rem);
  line-height: 1.35;
}

.hero-button {
  margin-top: 22px;
  padding: 11px 26px;

  display: inline-block;

  background: linear-gradient(180deg, #c71616, #850707);
  color: #fff;

  text-decoration: none;
  font-weight: 800;
  border-radius: 9px;

  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.hero-button:hover {
  filter: brightness(1.12);
}

/* ==========================================================
   Cards / Containers
   ========================================================== */

.container {
  width: min(1120px, calc(100% - 40px));
  max-width: 1120px;

  margin: 28px auto;
  padding: 28px 32px;

  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(238, 238, 238, 0.96));

  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);

  box-shadow: var(--card-shadow);
  backdrop-filter: blur(8px);
}

/* Solo la prima card della home sale sopra la hero */
.page > .container:first-of-type {
  margin-top: -58px;
  position: relative;
  z-index: 5;
}

.container h2 {
  color: var(--blue);
  border-bottom: 2px solid rgba(0, 0, 0, 0.12);
  padding-bottom: 8px;
  margin: 0 0 16px;
  font-size: 1.55em;
}

.container p {
  line-height: 1.45;
}

.container ul {
  list-style-type: disc;
  padding-left: 25px;
  color: #222;
  font-size: 1.05em;
  line-height: 1.7;
}

.container li {
  margin-bottom: 14px;
}

.container a {
  color: var(--link);
  font-weight: bold;
  text-decoration: underline;
}

.container a:hover {
  color: var(--link-hover);
}

/* ==========================================================
   Visitor Counter
   ========================================================== */

.visitor-counter {
  width: min(420px, calc(100% - 40px));
  max-width: 420px;

  margin: 32px auto 46px;
  padding: 24px 28px;

  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(238, 238, 238, 0.96));

  color: #333;
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);

  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;

  box-shadow: var(--card-shadow);
  backdrop-filter: blur(8px);
}

.visitor-counter h2 {
  width: 100%;
  margin: 0 0 14px;
  padding-bottom: 8px;

  color: var(--blue);
  border-bottom: 2px solid rgba(0, 0, 0, 0.12);

  font-size: 1.35rem;
}

.visitor-count {
  margin: 0;
  font-size: 2.6rem;
  font-weight: 800;
  color: #111827;
}

/* ==========================================================
   Notes / Flags
   ========================================================== */

.note {
  width: 100%;
  margin-top: 30px;
  padding: 12px;

  background-color: rgba(0, 0, 0, 0.72);
  border-left: 4px solid #ffcc00;

  color: #eee;
  font-style: italic;
}

.flag {
  height: 1em;
  width: auto;
  vertical-align: -0.15em;
  margin-left: 0.25em;
  border-radius: 2px;
}

/* ==========================================================
   Feedback page
   ========================================================== */

/*
  IMPORTANTE:
  Non tocchiamo html::before qui.
  Lo sfondo resta quello globale del sito:
  blur(4px) + scale(1.08), come servers / wads / banlist / rules.
*/

.feedback-page {
  width: 100%;
  flex: 1 0 auto;
  padding: 74px 0 56px;
}

/* Card principale feedback */
.feedback-card {
  width: min(760px, calc(100% - 40px));
  max-width: 760px;

  margin: 0 auto 26px;
  padding: 30px 34px;

  background:
    linear-gradient(180deg, rgba(24, 24, 24, 0.94), rgba(13, 13, 13, 0.92));

  color: #e5e7eb;

  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;

  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);

  backdrop-filter: blur(8px);
}

/* Se la pagina non usa ancora .feedback-page sul <main>,
   questo evita comunque che la card stia troppo attaccata all'header. */
.page > .feedback-card:first-child {
  margin-top: 74px;
}

/* Titoli */
.feedback-card h1,
.feedback-card h2 {
  margin: 0 0 18px;
  padding-bottom: 10px;

  color: #ffffff;
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);

  font-size: 1.8rem;
  line-height: 1.15;
  text-align: left;

  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.feedback-card p {
  color: #cbd5e1;
  line-height: 1.5;
}

/* Form */
#feedbackForm {
  display: grid;
  gap: 16px;
}

.feedback-card label {
  display: block;

  margin-bottom: 6px;

  color: #f8fafc;
  font-weight: 800;
}

/* Input e textarea */
.feedback-card input,
.feedback-card textarea {
  width: 100%;

  padding: 12px 14px;

  background: rgba(255, 255, 255, 0.96);
  color: #111827;

  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;

  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;

  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.feedback-card textarea {
  min-height: 170px;
  resize: vertical;
  line-height: 1.45;
}

.feedback-card input:focus,
.feedback-card textarea:focus {
  border-color: rgba(255, 95, 20, 0.75);
  box-shadow:
    0 0 0 3px rgba(255, 95, 20, 0.18),
    inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.feedback-card input::placeholder,
.feedback-card textarea::placeholder {
  color: #6b7280;
}

/* Contatore caratteri dentro la label */
#charCount {
  display: inline;
  margin: 0;

  color: #cbd5e1;
  font-size: inherit;
  font-weight: 900;
  text-align: inherit;
}

/* Se in futuro usi un contatore separato fuori dalla label */
.char-count {
  display: block;
  margin-top: 6px;

  color: #94a3b8;
  font-size: 0.9rem;
  text-align: right;
}

.feedback-card label[for="feedback"] {
  line-height: 1.35;
}

/* Bottone submit */
.feedback-card button[type="submit"] {
  width: fit-content;
  min-width: 180px;

  margin-top: 4px;
  padding: 12px 22px;

  background:
    linear-gradient(180deg, #ff5a1f, #c2410c);

  color: #fff;

  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;

  font-size: 1rem;
  font-weight: 900;

  cursor: pointer;

  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);

  transition: filter 0.15s ease, transform 0.02s ease;
}

.feedback-card button[type="submit"]:hover {
  filter: brightness(1.12);
}

.feedback-card button[type="submit"]:active {
  transform: translateY(1px);
}

.feedback-card button[type="submit"]:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Messaggi eventuali */
.feedback-message,
.feedback-error,
.feedback-success {
  margin: 0 0 18px;
  padding: 12px 14px;

  border-radius: 10px;

  line-height: 1.45;
  font-weight: 700;
}

.feedback-error {
  background: rgba(185, 28, 28, 0.18);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.feedback-success {
  background: rgba(22, 163, 74, 0.18);
  color: #bbf7d0;
  border: 1px solid rgba(74, 222, 128, 0.35);
}

/* Pagina feedback_success.php */
.feedback-success-page {
  width: 100%;
  flex: 1 0 auto;
  padding: 74px 0 56px;
}

.feedback-success-card,
.success-card {
  width: min(720px, calc(100% - 40px));
  max-width: 720px;

  margin: 0 auto 26px;
  padding: 30px 34px;

  background:
    linear-gradient(180deg, rgba(24, 24, 24, 0.94), rgba(13, 13, 13, 0.92));

  color: #e5e7eb;

  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 5px solid #22c55e;
  border-radius: 14px;

  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);

  backdrop-filter: blur(8px);
}

/* Fallback se success page non usa ancora .feedback-success-page */
.page > .feedback-success-card:first-child,
.page > .success-card:first-child {
  margin-top: 74px;
}

.feedback-success-card h1,
.success-card h1,
.feedback-success-card h2,
.success-card h2 {
  margin: 0 0 14px;
  color: #ffffff;
}

.feedback-success-card p,
.success-card p {
  color: #cbd5e1;
  line-height: 1.5;
}

.feedback-success-card a,
.success-card a,
.feedback-card a {
  color: #93c5fd;
  font-weight: 800;
}

.feedback-success-card a:hover,
.success-card a:hover,
.feedback-card a:hover {
  color: #bfdbfe;
}

/* Mobile */
@media (max-width: 900px) {
  .feedback-page,
  .feedback-success-page {
    padding: 34px 0 42px;
  }

  .feedback-card,
  .feedback-success-card,
  .success-card {
    width: calc(100% - 24px);
    padding: 24px 20px;
  }

  .page > .feedback-card:first-child,
  .page > .feedback-success-card:first-child,
  .page > .success-card:first-child {
    margin-top: 34px;
  }

  .feedback-card h1,
  .feedback-card h2 {
    font-size: 1.55rem;
  }

  .feedback-card button[type="submit"] {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .feedback-card,
  .feedback-success-card,
  .success-card {
    width: calc(100% - 18px);
    padding: 20px 16px;
  }

  .feedback-card textarea {
    min-height: 150px;
  }
}

/* ==========================================================
   Flash alerts
   ========================================================== */

.flash {
  position: sticky;
  top: calc(var(--header-h) + 8px);

  max-width: 860px;
  margin: 10px auto 0;
  padding: 12px 14px;

  display: flex;
  align-items: flex-start;
  gap: 10px;

  z-index: 950;

  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;

  background: rgba(202, 138, 4, 0.96);
  color: #111;

  backdrop-filter: blur(3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);

  font-size: 15px;
  line-height: 1.35;
}

.flash--error {
  background: rgba(185, 28, 28, 0.97);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

.flash--ok {
  background: rgba(22, 163, 74, 0.97);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

.flash__icon {
  font-size: 18px;
  line-height: 1;
  margin-top: 2px;
}

.flash__close {
  margin-left: auto;

  background: transparent;
  border: 0;
  color: inherit;

  font-weight: 700;
  font-size: 16px;

  cursor: pointer;
  opacity: 0.9;
}

.flash__close:hover {
  opacity: 1;
}

/* ==========================================================
   Footer
   ========================================================== */

footer,
.site-footer {
  margin-top: auto;

  width: 100%;

  background-color: #222;
  color: #fff;

  padding: 14px 0;

  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  line-height: 1.4;

  border-top: 1px solid #444;
}

footer p,
.site-footer p {
  margin: 0;
}

/* ==========================================================
   Responsive
   ========================================================== */

@media (max-width: 900px) {
  body {
    background-attachment: scroll;
  }

  .hero {
    min-height: 500px;
    padding: 48px 14px 82px;
  }

  .hero::after {
    background-size: auto 100%;
    background-position: center top;
  }

  .hero-content {
    width: min(420px, calc(100% - 24px));
    padding: 24px 18px;
  }

  .hero-logo {
    width: 165px;
  }

  .page > .container:first-of-type {
    margin-top: -46px;
  }
}

@media (max-width: 768px) {
  .container,
  .feedback-card {
    width: calc(100% - 24px);
    padding: 20px;
    margin: 22px auto;
  }

  .visitor-counter {
    width: calc(100% - 24px);
    max-width: 420px;
    padding: 22px 20px;
  }

  .hero-title,
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }
}

/* ==========================================================
   Rules & Policies pages
   ========================================================== */

.rules-page,
.policies-page {
  width: 100%;
  flex: 1 0 auto;
  padding: 74px 0 56px;
}

/* Evita l'effetto home: la prima card NON deve salire sopra una hero */
.rules-page > .container:first-of-type,
.policies-page > .container:first-of-type {
  margin-top: 0;
}

/* Card principale Rules/Policies */
.rules-page .container,
.policies-page .container {
  width: min(1180px, calc(100% - 40px));
  max-width: 1180px;
  margin: 0 auto 26px;
}

/* Titoli principali */
.rules-page h1,
.policies-page h1 {
  color: #004dff;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.12);
  font-size: 1.9rem;
}

/* Sottosezioni */
.rules-page h2,
.policies-page h2 {
  color: #004dff;
  margin: 24px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.12);
  font-size: 1.45rem;
}

/* Liste più ordinate */
.rules-page ul,
.policies-page ul {
  margin: 0 0 16px;
  padding-left: 0;
  list-style: none;
}

.rules-page li,
.policies-page li {
  position: relative;
  margin-bottom: 11px;
  padding-left: 24px;
  line-height: 1.55;
}

.rules-page li::before,
.policies-page li::before {
  content: "▪";
  position: absolute;
  left: 4px;
  top: 0;
  color: #c2410c;
  font-weight: 900;
}

/* Note più belle e coerenti */
.rules-page .note,
.policies-page .note {
  width: 100%;
  margin: 18px 0 22px;
  padding: 14px 16px;

  background:
    linear-gradient(180deg, rgba(35, 20, 0, 0.88), rgba(18, 12, 0, 0.84));

  border-left: 5px solid #f59e0b;
  border-radius: 10px;

  color: #f8fafc;
  font-style: normal;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.rules-page .note a,
.policies-page .note a {
  color: #facc15;
}

/* Le section.card interne non devono sembrare card rotte dentro la card */
.rules-page section.card,
.policies-page section.card {
  margin: 20px 0 0;
  padding: 18px 20px;

  background: rgba(0, 0, 0, 0.045);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
}

.rules-page section.card h2,
.policies-page section.card h2 {
  margin-top: 0;
}

/* Piccolo testo secondario tipo Last updated */
.muted {
  color: #666;
  font-size: 0.95rem;
}

/* Code inline nella pagina policies */
.policies-page code {
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  font-family: Consolas, "Courier New", monospace;
}

/* Layout policies: tante sezioni compatte dentro una singola card */
.policies-page .policies {
  padding: 30px 34px;
}

.policies-page .policies > section.card:first-child {
  margin-top: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .rules-page,
  .policies-page {
    padding: 34px 0 42px;
  }

  .rules-page .container,
  .policies-page .container {
    width: calc(100% - 24px);
    padding: 22px 18px;
  }

  .rules-page h1,
  .policies-page h1 {
    font-size: 1.65rem;
  }

  .rules-page h2,
  .policies-page h2 {
    font-size: 1.3rem;
  }

  .rules-page section.card,
  .policies-page section.card {
    padding: 16px 15px;
  }
}

