:root {
  --red: #a62920;
  --red-dark: #7f1f19;
  --cream: #fff8ec;
  --paper: #fffdf8;
  --ink: #321f1b;
  --muted: #7b625c;
  --line: #ead8c5;
  --shadow: 0 14px 38px rgba(92, 38, 28, .12);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { background: var(--cream); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(166, 41, 32, .08), transparent 28rem),
    var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-header {
  padding: max(18px, env(safe-area-inset-top)) 18px 18px;
  background: var(--red);
  color: white;
  box-shadow: 0 5px 24px rgba(80, 18, 13, .22);
}

.header-inner {
  width: min(1100px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.report-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 15px;
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 13px;
  background: rgba(255,255,255,.13);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: .92rem;
  transition: background .15s ease, transform .15s ease;
}
.report-button:hover,
.report-button:focus-visible {
  background: rgba(255,255,255,.22);
  transform: translateY(-1px);
}

.brand-logo { width: 58px; height: 58px; flex: 0 0 auto; }
h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(1.45rem, 5vw, 2.25rem); line-height: 1.05; }
.brand p { margin: 5px 0 0; opacity: .85; font-size: .92rem; }

.app-shell { width: min(1100px, 100%); margin: 0 auto; padding: 18px 12px 36px; }
.calendar-card {
  background: var(--paper);
  border: 1px solid rgba(166, 41, 32, .12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(12px, 3vw, 24px);
  overflow: hidden;
}

.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff0cd;
  border: 1px solid #e6c87d;
  font-size: .92rem;
}
.notice code { font-weight: 700; }

/* FullCalendar */
.fc { --fc-border-color: var(--line); --fc-page-bg-color: transparent; --fc-neutral-bg-color: #f8ecdd; --fc-today-bg-color: rgba(166, 41, 32, .07); }
.fc .fc-toolbar { gap: 10px; flex-wrap: wrap; }
.fc .fc-toolbar-title { font-family: Georgia, serif; color: var(--red-dark); font-size: clamp(1.25rem, 5vw, 1.8rem); text-transform: capitalize; }
.fc .fc-button-primary {
  background: var(--red);
  border-color: var(--red);
  border-radius: 11px;
  font-weight: 700;
  box-shadow: none;
}
.fc .fc-button-primary:hover,
.fc .fc-button-primary:focus,
.fc .fc-button-primary:not(:disabled).fc-button-active {
  background: var(--red-dark);
  border-color: var(--red-dark);
}
.fc .fc-col-header-cell-cushion,
.fc .fc-daygrid-day-number { color: var(--ink); text-decoration: none; }
.fc .fc-col-header-cell-cushion { padding: 9px 3px; font-size: .78rem; text-transform: uppercase; }
.fc .fc-daygrid-day-number { padding: 7px; font-weight: 700; }
.fc .fc-event {
  background: var(--red);
  border-color: var(--red);
  border-radius: 7px;
  padding: 2px 4px;
  cursor: pointer;
  font-weight: 700;
}
.fc .fc-list { border-radius: 14px; overflow: hidden; }
.fc .fc-list-day-cushion { background: #f5e5d2; }
.fc .fc-list-event:hover td { background: #fff3e4; }
.fc .fc-list-event-dot { border-color: var(--red); }
.fc .fc-list-event-title a { color: var(--ink); text-decoration: none; font-weight: 800; }
.fc .fc-list-event-time { display: none; }
.fc .fc-daygrid-more-link { color: var(--red); font-weight: 800; }

footer {
  text-align: center;
  padding: 0 20px calc(24px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: .82rem;
}

footer p {
  margin: 0;
}

.footer-credit {
  margin-top: 6px;
  font-size: .9rem;
}

.footer-credit strong {
  color: var(--red);
  font-weight: 700;
}

.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: end center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(35, 20, 17, .55); backdrop-filter: blur(3px); }
.modal-card {
  position: relative;
  width: min(560px, 100%);
  background: var(--paper);
  border-radius: 24px 24px 0 0;
  padding: 26px 22px calc(26px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 44px rgba(31, 15, 12, .25);
  animation: slide-up .2s ease-out;
}
.modal-close { position: absolute; top: 12px; right: 14px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #f2e4d6; color: var(--ink); font-size: 1.8rem; line-height: 1; cursor: pointer; }
.modal-kicker { margin: 0 0 5px; color: var(--red); font-weight: 900; text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; }
.modal h2 { margin: 0 44px 10px 0; font-family: Georgia, serif; font-size: 1.55rem; }
.modal-date { color: var(--muted); margin: 0 0 10px; text-transform: capitalize; }
.modal-location { margin: 0 0 20px; color: var(--ink); font-weight: 700; }

.modal-info { margin: 16px 0 20px; padding: 15px 16px; border-radius: 14px; background: #fff7ed; border: 1px solid rgba(166, 41, 32, .14); }
.modal-info[hidden] { display: none; }
.modal-info h3 { margin: 0 0 8px; color: var(--red-dark); font-size: .95rem; }
.modal-description { color: var(--ink); line-height: 1.55; overflow-wrap: anywhere; }
.modal-description a { color: var(--red-dark); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }

.primary-button { display: block; width: 100%; padding: 14px 18px; border-radius: 13px; background: var(--red); color: white; text-align: center; text-decoration: none; font-weight: 900; }
.modal-open { overflow: hidden; }
@keyframes slide-up { from { transform: translateY(30px); opacity: 0; } }

@media (max-width: 620px) {
  .app-header { position: sticky; top: 0; z-index: 10; padding-bottom: 14px; }
  .header-inner { align-items: stretch; gap: 10px; }
  .brand { flex: 1 1 auto; }
  .brand-logo { width: 48px; height: 48px; }
  .brand p { display: none; }
  .report-button { padding: 9px 11px; font-size: .82rem; align-self: center; }
  .report-button span { display: none; }
  .app-shell { padding: 12px 8px 28px; }
  .calendar-card { border-radius: 18px; padding: 10px; }
  .fc .fc-toolbar { align-items: center; }
  .fc .fc-toolbar-chunk:nth-child(2) { order: -1; width: 100%; text-align: center; }
  .fc .fc-toolbar-chunk:last-child .fc-dayGridMonth-button { display: none; }
  .fc .fc-list-event-title { font-size: 1rem; }
}

@media (min-width: 621px) {
  .modal { place-items: center; padding: 20px; }
  .modal-card { border-radius: 24px; }
}


/* Cookie notice */
.cookie-banner{position:fixed;inset:auto 0 0 0;z-index:9999;padding:14px;background:rgba(55,26,19,.25);backdrop-filter:blur(3px)}
.cookie-banner[hidden]{display:none!important}
.cookie-banner__box{max-width:760px;margin:0 auto;background:#fff7ed;border:1px solid rgba(166,41,32,.18);border-radius:18px;box-shadow:0 12px 35px rgba(76,34,21,.22);padding:18px}
.cookie-banner__box h2{margin:0 0 8px;color:#8f2119;font-size:1.15rem}
.cookie-banner__box p{margin:0;color:#4b2b22;line-height:1.5}
.cookie-banner__box a{color:#8f2119;font-weight:700}
.cookie-banner__actions{display:flex;justify-content:flex-end;margin-top:14px}
.cookie-button{border:0;border-radius:10px;padding:10px 16px;font:inherit;font-weight:700;cursor:pointer}
.cookie-button--primary{background:#a62920;color:#fff}
.footer-links a{color:inherit;text-decoration:underline}
.legal-card{padding:22px;line-height:1.6}
.legal-card h2{color:#8f2119}
@media (max-width:600px){.cookie-banner{padding:10px}.cookie-banner__box{border-radius:14px}}


/* Segnalazione sagra */
.report-page { min-height: 100vh; display: flex; flex-direction: column; }
.report-shell { width: min(720px, 100%); margin: 0 auto; padding: 24px 14px 40px; flex: 1; }
.report-card { background: var(--paper); border: 1px solid rgba(166, 41, 32, .12); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 4vw, 34px); }
.report-card h2 { margin: 0 0 8px; font-family: Georgia, serif; color: var(--red-dark); font-size: clamp(1.55rem, 5vw, 2rem); }
.report-intro { margin: 0 0 24px; color: var(--muted); line-height: 1.55; }
.report-form { display: grid; gap: 18px; }
.form-field { display: grid; gap: 7px; }
.form-field label { font-weight: 800; color: var(--ink); }
.form-field input, .form-field textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); padding: 13px 14px; font: inherit; outline: none; }
.form-field input:focus, .form-field textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(166,41,32,.10); }
.form-field textarea { resize: vertical; min-height: 140px; }
.optional-label { font-weight: 500; color: var(--muted); font-size: .9em; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.submit-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 12px 18px; border-radius: 12px; font: inherit; font-weight: 900; text-decoration: none; cursor: pointer; }
.submit-button { border: 0; background: var(--red); color: #fff; }
.submit-button:hover { background: var(--red-dark); }
.secondary-button { border: 1px solid var(--line); background: #fff7ed; color: var(--red-dark); }
.form-message { border-radius: 14px; padding: 13px 15px; margin: 0 0 20px; line-height: 1.45; }
.form-message--success { background: #edf8ef; border: 1px solid #bcdcc2; color: #285e31; }
.form-message--error { background: #fff0ee; border: 1px solid #e8b6b0; color: #842b22; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
@media (max-width: 620px) {
  .report-page .app-header { position: static; }
  .report-shell { padding-top: 14px; }
  .form-actions { display: grid; }
}


/* Restyling segnalazione */
.brand--link { color: inherit; text-decoration: none; }
.report-button {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px 10px 10px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: #fff8ec;
  color: var(--red-dark);
  text-decoration: none;
  font-weight: 850;
  font-size: .9rem;
  letter-spacing: -.01em;
  box-shadow: 0 5px 16px rgba(80,18,13,.16);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.report-button__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1;
}
.report-button:hover,
.report-button:focus-visible {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(80,18,13,.2);
}

.report-page { min-height: 100vh; display: flex; flex-direction: column; }
.report-header { padding-bottom: 20px; }
.header-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-weight: 750;
  font-size: .88rem;
  background: rgba(255,255,255,.08);
}
.header-back:hover { background: rgba(255,255,255,.15); }

.report-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: clamp(34px, 6vw, 70px) 18px 56px;
  flex: 1;
}
.report-hero {
  max-width: 760px;
  margin: 0 auto 28px;
  text-align: center;
}
.report-kicker {
  margin: 0 0 10px;
  color: var(--red);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.report-hero h2 {
  margin: 0;
  color: var(--red-dark);
  font-family: Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.03;
  letter-spacing: -.025em;
}
.report-hero > p:last-child {
  max-width: 650px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.08rem);
  line-height: 1.65;
}
.report-card {
  max-width: 820px;
  margin: 0 auto;
  background: rgba(255,253,248,.94);
  border: 1px solid rgba(166,41,32,.13);
  border-radius: 26px;
  box-shadow: 0 18px 55px rgba(92,38,28,.13);
  padding: clamp(24px, 4.5vw, 46px);
}
.report-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px 20px;
}
.form-field { display: grid; gap: 9px; align-content: start; }
.form-field--wide { grid-column: 1 / -1; }
.form-field label {
  color: var(--ink);
  font-size: .92rem;
  font-weight: 850;
  letter-spacing: -.01em;
}
.required-dot { color: var(--red); }
.optional-label {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f5e8d9;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
  vertical-align: 1px;
}
.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid #dfcdbc;
  border-radius: 15px;
  background: #fffdfa;
  color: var(--ink);
  padding: 15px 16px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.35;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.form-field input { min-height: 54px; }
.form-field textarea { min-height: 180px; resize: vertical; }
.form-field input::placeholder,
.form-field textarea::placeholder { color: #9c8580; opacity: 1; }
.form-field input:hover,
.form-field textarea:hover { border-color: #cdb6a3; }
.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--red);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(166,41,32,.09);
}
.field-hint {
  margin: -2px 2px 0;
  color: var(--muted);
  font-size: .79rem;
  line-height: 1.45;
}
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 4px;
}
.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  padding: 14px 22px;
  border: 0;
  border-radius: 15px;
  background: var(--red);
  color: #fff;
  font: inherit;
  font-weight: 900;
  font-size: .98rem;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(166,41,32,.2);
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.submit-button:hover,
.submit-button:focus-visible {
  background: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(127,31,25,.24);
}
.submit-button span { font-size: 1.25rem; line-height: 1; }
.form-note { margin: 0; color: var(--muted); font-size: .78rem; text-align: right; }
.form-message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-radius: 16px;
  padding: 15px 17px;
  margin: 0 0 26px;
  line-height: 1.45;
}
.form-message__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: #2f733c;
  color: #fff;
  font-weight: 900;
}
.form-message--success { background: #eef8ef; border: 1px solid #c5ddc9; color: #285e31; }
.form-message--error { background: #fff0ee; border: 1px solid #e8b6b0; color: #842b22; }

@media (max-width: 700px) {
  .report-button { padding: 8px 10px 8px 8px; gap: 7px; font-size: .8rem; }
  .report-button__icon { width: 25px; height: 25px; flex-basis: 25px; font-size: 1.08rem; }
  .report-shell { padding: 28px 12px 38px; }
  .report-card { border-radius: 20px; padding: 22px 17px 24px; }
  .report-form { grid-template-columns: 1fr; gap: 20px; }
  .form-field--wide { grid-column: auto; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .submit-button { width: 100%; }
  .form-note { text-align: center; }
  .header-back { display: none; }
  .report-hero { margin-bottom: 22px; }
}
@media (max-width: 420px) {
  .report-button__text { max-width: 92px; line-height: 1.08; }
  .report-page .brand p { display: none; }
}


/* SEO intro: contenuto descrittivo utile anche ai motori di ricerca */
.seo-intro {
  max-width: 980px;
  margin: 0 auto 18px;
  padding: 0 6px;
  text-align: center;
}
.seo-intro h2 {
  margin: 0 0 6px;
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  color: #7f1d17;
}
.seo-intro p {
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.55;
  color: #554842;
  font-size: .96rem;
}

/* SEO directory and crawlable event pages */
.brand--link { color: inherit; text-decoration: none; }
.seo-intro { margin: 0 0 16px; padding: 4px 8px 2px; }
.seo-intro h2, .section-heading h2, .seo-hero h2, .event-detail h2 { margin: 0; color: var(--red-dark); font-family: Georgia, serif; }
.seo-intro p, .section-heading p, .seo-hero p { line-height: 1.65; }
.seo-directory { margin-top: 28px; padding: clamp(20px,4vw,30px); background: rgba(255,253,248,.76); border: 1px solid rgba(166,41,32,.11); border-radius: var(--radius); }
.section-heading { max-width: 760px; margin-bottom: 18px; }
.section-heading > p:last-child { color: var(--muted); margin: 8px 0 0; }
.seo-kicker { margin: 0 0 7px; color: var(--red); font-size: .76rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.town-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.town-chips a { display:inline-flex; padding: 9px 13px; border-radius: 999px; background: #fff4e7; border: 1px solid var(--line); color: var(--red-dark); text-decoration:none; font-weight:800; }
.town-chips a:hover { background:#fff; border-color:rgba(166,41,32,.35); }
.event-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.event-card { background:#fff; border:1px solid var(--line); border-radius:16px; padding:17px; box-shadow:0 7px 22px rgba(92,38,28,.06); }
.event-card__date { margin:0 0 7px; color:var(--red); font-size:.78rem; font-weight:900; text-transform:uppercase; }
.event-card h3, .event-card h4 { margin:0 0 9px; font-family:Georgia,serif; font-size:1.16rem; line-height:1.2; }
.event-card h3 a, .event-card h4 a { color:var(--ink); text-decoration:none; }
.event-card__location { margin:0 0 10px; color:var(--muted); line-height:1.45; font-size:.91rem; }
.event-card__town { margin:0 0 12px; font-size:.85rem; }
.event-card__town a { color:var(--red-dark); font-weight:800; }
.event-card__link { color:var(--red-dark); font-weight:900; font-size:.9rem; text-decoration:none; }
.seo-page { padding-top:26px; }
.breadcrumbs { display:flex; flex-wrap:wrap; gap:7px; margin:0 0 22px; color:var(--muted); font-size:.86rem; }
.breadcrumbs a { color:var(--red-dark); font-weight:750; }
.seo-hero, .event-detail { background:var(--paper); border:1px solid rgba(166,41,32,.12); border-radius:var(--radius); box-shadow:var(--shadow); padding:clamp(24px,5vw,42px); }
.seo-hero h2, .event-detail h2 { font-size:clamp(2rem,5vw,3rem); line-height:1.05; }
.seo-hero > p:last-child { max-width:800px; color:var(--muted); }
.seo-events, .town-links { margin-top:28px; }
.seo-events > h3, .town-links > h3 { font-family:Georgia,serif; color:var(--red-dark); font-size:1.45rem; }
.empty-state { padding:28px; border:1px dashed rgba(166,41,32,.3); background:#fff8ec; border-radius:18px; text-align:center; }
.primary-inline, .secondary-inline { display:inline-flex; align-items:center; justify-content:center; padding:12px 16px; border-radius:12px; font-weight:900; text-decoration:none; }
.primary-inline { background:var(--red); color:#fff; }
.secondary-inline { background:#fff4e7; color:var(--red-dark); border:1px solid var(--line); }
.event-detail__meta { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:24px 0; }
.event-detail__meta p { margin:0; padding:15px; border-radius:14px; background:#fff7ed; border:1px solid var(--line); }
.event-detail__meta strong, .event-detail__meta span { display:block; }
.event-detail__meta span { margin-top:6px; color:var(--muted); line-height:1.45; }
.event-detail__info { margin-top:22px; padding:20px; border-radius:16px; background:#fff7ed; border:1px solid rgba(166,41,32,.14); line-height:1.65; }
.event-detail__info h3 { margin:0 0 10px; color:var(--red-dark); }
.event-detail__info a { color:var(--red-dark); font-weight:800; }
.event-detail__actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:22px; }
.modal-page-link { margin-top:10px; width:100%; }
@media (max-width:800px){ .event-grid{grid-template-columns:1fr 1fr;} }
@media (max-width:560px){ .event-grid{grid-template-columns:1fr;} .event-detail__meta{grid-template-columns:1fr;} .seo-directory{padding:18px 14px;} }

/* Sagra Challenge */
.header-actions{display:flex;align-items:center;gap:10px}.challenge-header,.challenge-inline{display:inline-flex;align-items:center;justify-content:center;padding:11px 15px;border-radius:12px;background:#2b211d;color:#fff;text-decoration:none;font-weight:900}.challenge-promo{margin:24px 0;padding:24px 28px;border-radius:var(--radius);background:#2b211d;color:#fff;display:flex;align-items:center;justify-content:space-between;gap:20px}.challenge-promo h2{font-family:Georgia,serif;margin:2px 0 7px;font-size:clamp(1.45rem,3vw,2rem)}.challenge-promo p{margin:0;max-width:700px;line-height:1.55}.challenge-promo .seo-kicker{color:#ffd166}.challenge-shell{padding-top:28px}.challenge-hero{text-align:center;max-width:800px;margin:0 auto 24px}.challenge-hero h2,.leaderboard h2{font-family:Georgia,serif;color:var(--red-dark);font-size:clamp(2rem,5vw,3.2rem);margin:0 0 10px}.challenge-hero p{line-height:1.6}.challenge-two{display:grid;grid-template-columns:1fr 1fr;gap:18px}.challenge-card,.player-card,.recovery-card,.rules-card,.leaderboard{background:var(--paper);border:1px solid rgba(166,41,32,.13);border-radius:18px;padding:22px;box-shadow:0 7px 22px rgba(92,38,28,.06);margin-bottom:20px}.challenge-card h3,.player-card h3,.rules-card h3{font-family:Georgia,serif;color:var(--red-dark);font-size:1.4rem;margin:0 0 10px}.challenge-card form,.challenge-card{gap:14px}.challenge-card label{display:flex;flex-direction:column;gap:7px;font-weight:800;margin:12px 0}.challenge-card input,.challenge-card select{width:100%;box-sizing:border-box;padding:12px;border:1px solid var(--line);border-radius:10px;background:#fff;font:inherit}.challenge-card small{font-weight:400;color:var(--muted)}.challenge-alert{padding:14px 17px;border-radius:12px;background:#e8f5e9;color:#205c2a;margin:0 0 18px;font-weight:800}.challenge-alert--error{background:#fff0ed;color:#8a211b}.player-card{display:flex;justify-content:space-between;align-items:center}.player-stats{text-align:right}.player-stats strong,.player-stats span{display:block}.player-stats strong{font-size:1.8rem;color:var(--red)}.recovery-card{background:#fff3cd}.recovery-card code{display:block;font-size:clamp(1.25rem,4vw,2rem);font-weight:900;letter-spacing:.08em;margin:10px 0}.leader-list{display:grid;gap:8px}.leader-row{display:grid;grid-template-columns:52px 1fr auto 100px;align-items:center;gap:12px;padding:13px 14px;border-radius:12px;background:#fff7ed}.leader-pos{font-family:monospace;font-size:1.2rem;font-weight:900;color:var(--red)}.leader-row b{text-align:right}.rules-card p{line-height:1.65;margin-bottom:0}.admin-login{max-width:520px;margin:30px auto}.admin-claims{display:grid;gap:14px}.admin-claim{display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:15px}.admin-actions{display:flex;gap:8px}.admin-actions form{margin:0}.status{display:inline-block;padding:4px 8px;border-radius:999px;font-size:.72rem;font-weight:900;text-transform:uppercase;background:#eee}.status--pending{background:#fff3cd}.status--approved{background:#e8f5e9}.status--rejected{background:#fde8e7}.claim-card{max-width:700px;margin-left:auto;margin-right:auto}
@media(max-width:700px){.header-actions{gap:5px}.challenge-header{font-size:.78rem;padding:9px}.challenge-promo{align-items:flex-start;flex-direction:column}.challenge-two{grid-template-columns:1fr}.player-card{align-items:flex-start}.leader-row{grid-template-columns:42px 1fr auto}.leader-row>span:nth-child(3){display:none}.admin-claim{grid-template-columns:1fr}.admin-actions{flex-wrap:wrap}}

.modal-challenge-link{display:flex;justify-content:center;align-items:center;width:100%;margin-top:10px;text-align:center;box-sizing:border-box}

.rules-card--top{margin-top:0;margin-bottom:26px;padding:26px}
.rules-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px}
.rules-heading h2{font-family:Georgia,serif;color:var(--red-dark);font-size:clamp(1.7rem,4vw,2.45rem);margin:2px 0 0}
.rules-badge{flex:0 0 auto;border-radius:999px;background:var(--red);color:#fff;font-weight:900;padding:7px 12px;letter-spacing:.05em}
.rules-steps{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:16px 0 18px}
.rule-step{display:flex;gap:12px;align-items:flex-start;background:#fff;border:1px solid var(--line);border-radius:14px;padding:15px}
.rule-step>strong{display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;border-radius:50%;background:var(--red);color:#fff;font-size:1rem}
.rule-step h3{font-size:1rem!important;margin:0 0 5px!important}
.rule-step p{margin:0;line-height:1.48;color:var(--muted);font-size:.94rem}
.points-box{background:#fff7ed;border:1px solid rgba(166,41,32,.15);border-radius:16px;padding:18px;margin-top:4px}
.points-box h3{margin:0 0 12px!important}
.points-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.points-grid>div{background:#fff;border-radius:12px;padding:13px;text-align:center;border:1px solid var(--line)}
.points-grid span,.points-grid strong{display:block}
.points-grid span{font-size:.88rem;color:var(--muted);margin-bottom:4px}
.points-grid strong{font-size:1.25rem;color:var(--red-dark)}
.rules-note{margin:13px 0 0;line-height:1.5}
.rules-foot{display:grid;gap:7px;margin-top:16px}
.rules-foot p{margin:0;line-height:1.45}
@media(max-width:760px){
  .rules-card--top{padding:18px}
  .rules-steps{grid-template-columns:1fr}
  .points-grid{grid-template-columns:1fr 1fr}
  .rules-heading{align-items:center}
}

/* Recensioni verificate Sagra Challenge */
.reviews-area{margin-top:28px}.review-form-card{margin-bottom:18px}.review-form{display:grid;gap:18px}.emoji-rating{border:0;padding:0;margin:0}.emoji-rating legend{font-weight:800;margin-bottom:9px}.emoji-rating__choices{display:flex;gap:8px;flex-wrap:wrap}.emoji-rating__choices label{position:relative;cursor:pointer}.emoji-rating__choices input{position:absolute;opacity:0;pointer-events:none}.emoji-rating__choices span{display:grid;place-items:center;width:48px;height:48px;border:1px solid #ead3bf;border-radius:14px;background:#fff8ef;font-size:23px;transition:.15s}.emoji-rating__choices small{display:block;text-align:center;margin-top:3px;color:#7b625a}.emoji-rating__choices input:checked+span{background:#b92b21;border-color:#b92b21;transform:translateY(-2px)}.emoji-rating__choices label:has(input:focus-visible) span{outline:3px solid rgba(185,43,33,.25);outline-offset:2px}.review-form textarea{width:100%;resize:vertical}.rating-help{font-size:.9rem;color:#7b625a}.review-sent{font-weight:700;color:#4e6b45}.admin-review-heading{margin-top:38px}.review-comment{font-style:italic}.event-reviews{margin:24px 0;padding:22px;border:1px solid #ead3bf;border-radius:20px;background:#fffaf4}.reviews-summary{display:flex;align-items:end;justify-content:space-between;gap:16px}.reviews-summary h3{font-size:2rem;margin:3px 0}.review-averages{display:flex;gap:9px;flex-wrap:wrap;margin:15px 0 18px}.review-averages span{padding:8px 11px;border-radius:999px;background:#f7eadc;font-weight:700}.public-review{padding:16px 0;border-top:1px solid #eadfd5}.public-review>div{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.public-review>div span{font-size:.82rem;color:#4e6b45;font-weight:800}.review-icons{font-size:.92rem;color:#604a43}
@media(max-width:600px){.emoji-rating__choices{justify-content:space-between;gap:4px}.emoji-rating__choices span{width:44px;height:44px}.reviews-summary{align-items:flex-start;flex-direction:column;gap:4px}}


.review-at-checkin{margin:18px 0;border:1px solid var(--border,#e1ddd3);border-radius:16px;background:rgba(255,255,255,.45);overflow:hidden}
.review-at-checkin summary{cursor:pointer;padding:16px 18px;font-weight:800;list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px}
.review-at-checkin summary::-webkit-details-marker{display:none}
.review-at-checkin summary span{font-size:.78rem;font-weight:700;opacity:.65;text-transform:uppercase;letter-spacing:.04em}
.review-at-checkin__body{padding:0 18px 18px}
.review-at-checkin__body>p:first-child{margin-top:0;opacity:.78}
.review-enable{display:flex!important;flex-direction:row!important;align-items:center;gap:10px;margin:14px 0 18px;font-weight:800}
.review-enable input{width:auto!important;margin:0}
.status--waiting_checkin{background:#f1eee7;color:#665e51}

.admin-attached-review{margin-top:12px;padding:12px 14px;border-radius:12px;background:rgba(255,255,255,.5);border:1px solid var(--border,#e1ddd3)}
.admin-attached-review p{margin:.45rem 0 0}


.event-reviews{margin-top:22px;padding:20px;border:1px solid var(--border,#e1ddd3);border-radius:18px;background:rgba(255,255,255,.58)}
.reviews-summary{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;flex-wrap:wrap}
.reviews-summary h3{font-size:2rem;margin:.15rem 0}
.reviews-summary p{margin:.25rem 0}
.verified-review-badge{font-size:.82rem;font-weight:800;padding:8px 10px;border-radius:999px;background:rgba(255,255,255,.7);border:1px solid var(--border,#e1ddd3)}
.review-average-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:18px}
.review-average-grid>div{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;border-radius:12px;background:rgba(255,255,255,.65)}
.review-average-grid span{min-width:0}
.review-average-grid strong{white-space:nowrap}
.public-reviews-list{margin-top:16px;display:grid;gap:10px}
.public-review{padding:14px;border-radius:12px;background:rgba(255,255,255,.62)}
.public-review>div{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
.public-review>div span{font-size:.78rem;font-weight:700;opacity:.68}
.public-review p{margin:.55rem 0 0}
@media(max-width:640px){.review-average-grid{grid-template-columns:1fr}.event-reviews{padding:16px}}


@media(max-width:640px){
  .review-ranking__top{grid-template-columns:auto minmax(0,1fr)}
  .review-ranking__score{grid-column:2;margin-top:2px;font-size:1.5rem}
  .review-ranking__averages{padding-left:0}
  .review-ranking__link{margin-left:0}
}


.reviews-header{display:inline-flex;align-items:center;justify-content:center;padding:11px 15px;border:1px solid rgba(255,255,255,.48);border-radius:13px;background:rgba(255,255,255,.13);color:#fff;text-decoration:none;font-weight:800;font-size:.92rem;white-space:nowrap}
.reviews-header:hover,.reviews-header:focus-visible{background:rgba(255,255,255,.22)}
.reviews-page{padding-top:28px}
.reviews-page__intro{max-width:780px;margin:8px 0 24px}
.reviews-page__intro h2{font-family:Georgia,serif;color:var(--red-dark);font-size:clamp(2rem,5vw,3rem);margin:3px 0 10px}
.reviews-page__intro p{line-height:1.6}
.reviews-ranking-list{display:grid;gap:14px}
.review-ranking__card--page{background:var(--paper);border-color:rgba(166,41,32,.13);box-shadow:0 7px 22px rgba(92,38,28,.06)}
.review-ranking__averages--labels span{display:inline-flex;align-items:center;gap:5px}
.review-ranking__averages--labels em{font-style:normal;color:var(--muted)}
.reviews-page__note{margin:18px 0;color:var(--muted);font-size:.83rem}
.reviews-empty{max-width:700px}

@media(max-width:760px){
  .header-actions{flex-wrap:wrap;justify-content:flex-end}
  .reviews-header,.report-button,.challenge-header{font-size:.76rem;padding:9px 10px}
}
@media(max-width:540px){
  .header-inner{align-items:flex-start}
  .header-actions{max-width:145px}
  .reviews-header,.report-button,.challenge-header{width:100%;justify-content:center}
  .report-button__text{white-space:nowrap}
}


/* Reviews directory */
.brand--link{color:inherit;text-decoration:none}
.header-back{display:inline-flex;align-items:center;justify-content:center;padding:10px 14px;border:1px solid rgba(255,255,255,.45);border-radius:999px;color:#fff;text-decoration:none;font-weight:800;font-size:.82rem}
.header-back:hover{background:rgba(255,255,255,.12)}
.breadcrumbs{display:flex;align-items:center;gap:8px;margin:4px 0 24px;color:var(--muted);font-size:.84rem}
.breadcrumbs a{color:var(--red-dark);font-weight:800}
.reviews-page{max-width:1100px}
.reviews-page__intro{max-width:820px;margin:0 0 28px}
.reviews-page__intro .seo-kicker{margin-bottom:8px}
.reviews-page__intro h2{margin:0 0 12px;font-family:Georgia,serif;font-size:clamp(2rem,5vw,3.2rem);line-height:1.05;color:var(--red-dark)}
.reviews-page__intro>p:last-child{margin:0;color:var(--ink);font-size:1rem;line-height:1.65}
.reviews-ranking-list{display:grid;gap:14px;margin:0 0 20px}
.review-ranking__card--page{position:relative;background:var(--paper);border:1px solid rgba(166,41,32,.13);border-radius:18px;padding:18px 20px;box-shadow:0 7px 22px rgba(92,38,28,.06)}
.review-ranking__top{display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:14px}
.review-ranking__position{width:38px;height:38px;display:grid;place-items:center;border-radius:50%;background:var(--red);color:#fff;font-weight:900;font-size:1rem}
.review-ranking__card--page:nth-child(1) .review-ranking__position{background:#b8860b}
.review-ranking__card--page:nth-child(2) .review-ranking__position{background:#777}
.review-ranking__card--page:nth-child(3) .review-ranking__position{background:#9a5b35}
.review-ranking__name h3{margin:0;font-family:Georgia,serif;font-size:1.35rem;line-height:1.15}
.review-ranking__name h3 a{color:var(--red-dark);text-decoration:none}
.review-ranking__name h3 a:hover{text-decoration:underline}
.review-ranking__name>span{display:block;margin-top:5px;color:var(--muted);font-size:.82rem}
.review-ranking__score{font-family:Georgia,serif;font-size:2rem;line-height:1;color:var(--red-dark);white-space:nowrap}
.review-ranking__score small{font-size:.82rem;color:var(--muted);margin-left:2px}
.review-ranking__averages{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:16px 0 0 52px}
.review-ranking__averages span{display:flex;align-items:center;gap:6px;min-width:0;padding:9px 11px;border-radius:11px;background:#fff3e4;font-size:.85rem}
.review-ranking__averages em{font-style:normal;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.review-ranking__averages b{margin-left:auto;color:var(--ink)}
.review-ranking__link{display:inline-block;margin:13px 0 0 52px;color:var(--red);font-weight:800;text-decoration:none;font-size:.86rem}
.review-ranking__link:hover{text-decoration:underline}
.reviews-page__note{margin:16px 0 28px;color:var(--muted);font-size:.82rem;line-height:1.5}

@media(max-width:720px){
  .reviews-page{padding-top:20px}
  .reviews-page__intro h2{font-size:clamp(1.9rem,10vw,2.6rem)}
  .review-ranking__top{grid-template-columns:38px minmax(0,1fr)}
  .review-ranking__score{grid-column:2;font-size:1.55rem;margin-top:-2px}
  .review-ranking__averages{grid-template-columns:1fr 1fr;margin-left:0}
  .review-ranking__link{margin-left:0}
}
@media(max-width:430px){
  .review-ranking__card--page{padding:15px}
  .review-ranking__averages{grid-template-columns:1fr}
  .header-back{font-size:.75rem;padding:8px 10px}
}

.recovery-email-card{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:-6px 0 20px;padding:16px 20px;border:1px solid rgba(166,41,32,.13);border-radius:16px;background:#fff7ed}.recovery-email-card p{margin:5px 0 0;color:var(--muted);font-size:.88rem}.recovery-email-card form{display:flex;align-items:center;gap:8px;min-width:min(100%,430px)}.recovery-email-card input,.lost-code-form input{width:100%;padding:11px 12px;border:1px solid var(--line);border-radius:10px;background:#fff;font:inherit}.lost-code-card{max-width:760px;margin:18px auto 20px}.lost-code-form{display:grid;grid-template-columns:1fr 1fr auto;align-items:end;gap:10px}.lost-code-form label{margin:0}.reset-success{max-width:700px;margin:0 auto}@media(max-width:720px){.recovery-email-card{align-items:stretch;flex-direction:column}.recovery-email-card form{min-width:0;flex-direction:column;align-items:stretch}.lost-code-form{grid-template-columns:1fr}}

.footer-links a{color:var(--red-dark);font-weight:700;text-decoration:none}.footer-links a:hover{text-decoration:underline}
.contact-page{max-width:900px;padding-top:28px}.contact-intro{max-width:760px;margin-bottom:22px}.contact-intro h2{font-family:Georgia,serif;color:var(--red-dark);font-size:clamp(2rem,5vw,3rem);margin:3px 0 10px}.contact-intro p{line-height:1.6}
.contact-card{background:var(--paper);border:1px solid rgba(166,41,32,.13);border-radius:18px;padding:22px;box-shadow:0 7px 22px rgba(92,38,28,.06)}.contact-card form{display:grid;gap:15px}.contact-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.contact-card label{display:flex;flex-direction:column;gap:7px;font-weight:800}.contact-card input,.contact-card select,.contact-card textarea{width:100%;padding:12px;border:1px solid var(--line);border-radius:10px;background:#fff;font:inherit;color:var(--ink)}.contact-card textarea{resize:vertical}.contact-note{margin:0;color:var(--muted);font-size:.8rem}.contact-hp{position:absolute!important;left:-9999px!important;width:1px;height:1px;overflow:hidden}
@media(max-width:620px){.contact-grid{grid-template-columns:1fr}.contact-card{padding:17px}}

.site-help-strip{margin:26px 0 4px;padding:14px 16px;border:1px solid rgba(166,41,32,.16);border-radius:14px;background:rgba(255,253,248,.75);display:flex;align-items:center;justify-content:space-between;gap:16px}
.site-help-strip>div{min-width:0}
.site-help-strip strong{display:block;color:var(--red-dark);font-size:.92rem}
.site-help-strip span{display:block;margin-top:3px;color:var(--muted);font-size:.8rem;line-height:1.35}
.site-help-strip a{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;padding:9px 12px;border-radius:10px;background:#fff3e4;border:1px solid rgba(166,41,32,.16);color:var(--red-dark);text-decoration:none;font-weight:900;font-size:.82rem}
.site-help-strip a:hover{background:#f9e1c8}
@media(max-width:560px){.site-help-strip{align-items:flex-start;flex-direction:column}.site-help-strip a{width:100%}}

/* Sagra Challenge v49: quarto step recensione */
.rules-steps{grid-template-columns:repeat(4,minmax(0,1fr))}
.rules-note--review{margin-top:10px;padding-top:10px;border-top:1px solid rgba(166,41,32,.13);color:var(--red-dark)}
@media(max-width:980px){.rules-steps{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.rules-steps{grid-template-columns:1fr}}

.footer-author{color:inherit;text-decoration:none}.footer-author:hover{text-decoration:underline}

/* Backend Challenge: elementi da moderare in primo piano, storico raccolto negli archivi */
.admin-archive{margin:22px 0 42px;border:1px solid rgba(143,33,25,.16);border-radius:18px;background:rgba(255,255,255,.45);overflow:hidden}
.admin-archive>summary{cursor:pointer;list-style:none;padding:18px 22px;font-weight:800;color:#8f2119;display:flex;align-items:center;justify-content:space-between;gap:16px}
.admin-archive>summary::-webkit-details-marker{display:none}
.admin-archive>summary:after{content:"＋";font-size:1.3rem;line-height:1}
.admin-archive[open]>summary:after{content:"−"}
.admin-archive>summary span{margin-left:auto;background:#fff0df;color:#6d554c;border-radius:999px;padding:3px 10px;font-size:.82rem}
.admin-archive-list{padding:0 18px 18px}
.admin-claim--archived{opacity:.84}
.admin-empty{padding:22px}.admin-empty p{margin:.35rem 0 0;color:#765f55}


/* v58: calendario mensile più leggibile, con celle più alte e tutte le sagre visibili */
@media (min-width: 769px){
  #calendar .fc-daygrid-day-frame{
    min-height: 128px;
  }
  #calendar .fc-daygrid-day-events{
    min-height: 0;
  }
}


/* v60: il pulsante "Segnala una sagra" resta leggibile anche da mobile */
@media (max-width: 620px){
  .header-actions .report-button{
    display:flex;
    min-height:40px;
    padding:8px 10px;
  }
  .header-actions .report-button .report-button__icon{
    display:grid;
    width:24px;
    height:24px;
    flex:0 0 24px;
  }
  .header-actions .report-button .report-button__text{
    display:inline;
    max-width:none;
    white-space:nowrap;
    font-size:.74rem;
    line-height:1;
  }
}


/* v64: estratto punti personale */
.points-ledger{
  margin:14px 0 18px;
  border:1px solid rgba(166,41,32,.16);
  border-radius:20px;
  background:#fffaf2;
  overflow:hidden;
}
.points-ledger>summary{
  list-style:none;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:17px 19px;
}
.points-ledger>summary::-webkit-details-marker{display:none}
.points-ledger>summary span{display:grid;gap:3px}
.points-ledger>summary small{color:var(--muted);font-weight:500}
.points-ledger>summary>b{white-space:nowrap;color:var(--red-dark)}
.points-ledger[open]>summary{border-bottom:1px solid rgba(166,41,32,.12)}
.points-ledger__body{padding:8px 18px 16px}
.points-ledger__list{display:grid}
.points-ledger__row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:13px 2px;
  border-bottom:1px solid rgba(70,45,34,.09);
}
.points-ledger__main{display:grid;gap:3px;min-width:0}
.points-ledger__main strong{color:var(--ink)}
.points-ledger__main span{font-size:.82rem;color:var(--muted)}
.points-ledger__value{font-size:.82rem;font-weight:900;white-space:nowrap;color:var(--muted)}
.points-ledger__value--earned{color:#285e31}
.points-ledger__row--muted{opacity:.72}
.points-ledger__total{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:16px 2px 2px;
  font-weight:800;
}
.points-ledger__total strong{font-size:1.15rem;color:var(--red-dark)}
.points-ledger__empty{margin:8px 0;color:var(--muted)}
@media(max-width:620px){
  .points-ledger>summary{padding:15px 14px;align-items:flex-start}
  .points-ledger>summary small{font-size:.76rem}
  .points-ledger__body{padding:6px 14px 14px}
  .points-ledger__row{align-items:flex-start}
  .points-ledger__main span{font-size:.76rem}
}
