:root {
  --rosso: #a4161a;
  --rosso-scuro: #660708;
  --verde: #1b4332;
  --verde-chiaro: #2d6a4f;
  --oro: #d4a017;
  --crema: #fdf8f0;
  --testo: #2b2b2b;
  --grigio: #6b6b6b;
  --whatsapp: #25d366;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--testo);
  background: var(--verde) linear-gradient(180deg, var(--verde) 0%, #081c15 100%) fixed;
  min-height: 100vh;
  line-height: 1.5;
}

/* Schneefall */
.snow {
  pointer-events: none;
  position: fixed; inset: 0;
  background-image:
    radial-gradient(2px 2px at 20px 30px, #fff, transparent),
    radial-gradient(2px 2px at 80px 120px, rgba(255,255,255,.8), transparent),
    radial-gradient(3px 3px at 150px 60px, rgba(255,255,255,.7), transparent),
    radial-gradient(2px 2px at 220px 180px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 300px 90px, rgba(255,255,255,.9), transparent);
  background-size: 320px 220px;
  animation: neve 18s linear infinite;
  opacity: .5;
  z-index: 0;
}
@keyframes neve { to { background-position: 0 220px; } }
@media (prefers-reduced-motion: reduce) { .snow { animation: none; } }

.hero {
  position: relative; z-index: 1;
  text-align: center;
  padding: 48px 20px 28px;
  color: #fff;
}
.hero-deco { color: var(--oro); font-size: 1.4rem; letter-spacing: .4em; }
.hero h1 {
  margin: 10px auto 8px;
  max-width: 760px;
  font-size: clamp(1.7rem, 5vw, 2.7rem);
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0,0,0,.4);
}
.evento {
  display: inline-block;
  margin: 6px auto 14px;
  padding: 8px 18px;
  border: 1.5px solid var(--oro);
  border-radius: 999px;
  color: var(--oro);
  font-size: clamp(1rem, 3.2vw, 1.15rem);
  font-weight: bold;
  letter-spacing: .02em;
}
.sottotitolo { margin: 0 auto; max-width: 560px; opacity: .85; font-style: italic; }

/* Inbegriffene Gänge */
.portata.fisso { border-top-color: var(--oro); }
.portata.fisso .portata-info { color: #7a5c00; background: #f7ecc9; }
.piatto-fisso { cursor: default; background: #fffdf8; border-style: dashed; }
.piatto-fisso:hover { border-color: #ece3d3; }
.piatto-fisso:active { transform: none; }
.stella { color: var(--oro); flex: 0 0 22px; text-align: center; }

.prezzo {
  text-align: center;
  color: var(--oro);
  font-size: 1.3rem;
  font-weight: bold;
  margin: 4px 0 22px;
}

.container {
  position: relative; z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.card {
  background: var(--crema);
  border: none;
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 0 0 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  border-top: 5px solid var(--rosso);
}

.label-grande { display: block; font-weight: bold; font-size: 1.15rem; margin-bottom: 8px; color: var(--rosso-scuro); }
.req { color: var(--rosso); }
.opz { font-weight: normal; font-size: .9rem; color: var(--grigio); }

input[type="text"], textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 12px 14px;
  border: 2px solid #ddd2c0;
  border-radius: 10px;
  background: #fff;
  transition: border-color .2s;
}
input[type="text"]:focus, textarea:focus { outline: none; border-color: var(--verde-chiaro); }
.invalido { border-color: var(--rosso) !important; }
textarea { resize: vertical; }

.errore { color: var(--rosso); font-size: .92rem; margin: 8px 0 0; }

/* Gänge */
.portata legend {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  width: 100%;
  float: left;
  margin-bottom: 12px;
}
.portata .piatti { clear: both; }
.portata-nome { font-size: 1.35rem; font-weight: bold; color: var(--rosso-scuro); }
.portata-info {
  font-size: .78rem; font-family: system-ui, sans-serif;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--verde-chiaro); background: #e3efe8;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}

.piatti { display: grid; gap: 10px; }

.piatto {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  background: #fff;
  border: 2px solid #ece3d3;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.piatto:hover { border-color: var(--oro); }
.piatto:active { transform: scale(.99); }
.piatto input { position: absolute; opacity: 0; pointer-events: none; }

.segno {
  flex: 0 0 22px; height: 22px;
  border: 2px solid #b9ab92;
  background: #fff;
  display: grid; place-items: center;
  transition: all .15s;
}
.segno.radio { border-radius: 50%; }
.segno.checkbox { border-radius: 6px; }
.segno::after { content: ""; opacity: 0; transition: opacity .15s; }
.segno.radio::after { width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.segno.checkbox::after {
  width: 6px; height: 11px;
  border: solid #fff; border-width: 0 3px 3px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.piatto:has(input:checked) { border-color: var(--verde-chiaro); background: #eef6f1; }
.piatto input:checked + .segno { background: var(--verde-chiaro); border-color: var(--verde-chiaro); }
.piatto input:checked + .segno::after { opacity: 1; }
.piatto input:focus-visible + .segno { box-shadow: 0 0 0 3px rgba(212,160,23,.6); }

/* Zusammenfassung */
.riepilogo { border-top-color: var(--oro); }
.riepilogo h2 { margin: 0 0 10px; color: var(--verde); }
.riepilogo-testo h3 { margin: 12px 0 4px; font-size: 1.02rem; color: var(--rosso-scuro); }
.riepilogo-testo ul { margin: 0; padding-left: 20px; }
.riepilogo-testo p { margin: 4px 0; }
.riepilogo-testo.vuoto { color: var(--grigio); font-style: italic; }

/* Buttons */
.azioni { display: flex; flex-direction: column; gap: 10px; }
.btn-whatsapp, .btn-reset {
  font: inherit; font-family: system-ui, sans-serif; font-weight: 600;
  border: none; border-radius: 999px; cursor: pointer;
  padding: 16px 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .1s, filter .2s;
}
.btn-whatsapp { background: var(--whatsapp); color: #fff; font-size: 1.1rem; box-shadow: 0 6px 18px rgba(37,211,102,.35); }
.btn-whatsapp:hover { filter: brightness(1.05); }
.btn-whatsapp:active, .btn-reset:active { transform: scale(.98); }
.btn-reset { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.5); }
.btn-reset:hover { border-color: #fff; }

.footer { position: relative; z-index: 1; text-align: center; color: var(--oro); padding: 10px 0 30px; font-style: italic; }

@media (min-width: 600px) {
  .piatti { grid-template-columns: 1fr 1fr; }
  .azioni { flex-direction: row-reverse; justify-content: flex-start; }
}

/* Speicher-Status */
.stato {
  margin: 14px 0 0; padding: 12px 16px; border-radius: 10px;
  font-family: system-ui, sans-serif; font-size: .95rem;
  background: rgba(255,255,255,.12); color: #fff;
}
.stato.ok { background: #d8f3dc; color: #1b4332; }
.stato.err { background: #ffe3e3; color: #7a0c0c; }
.stato a { color: inherit; font-weight: 600; }
.btn-whatsapp:disabled { opacity: .6; cursor: wait; }
.nota-agg { color: rgba(255,255,255,.7); font-size: .88rem; text-align: center; font-style: italic; margin: 14px 0 0; }
.link-tabella {
  display: block; text-align: center; margin: 22px auto 0;
  color: var(--oro); font-weight: bold; text-decoration: none; font-size: 1.05rem;
}
.link-tabella:hover { text-decoration: underline; }

/* ===== Tabellen-Seite ===== */
.hero-piccolo { padding: 32px 20px 18px; }
.container-largo { max-width: 1100px; }
.barra { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.btn-sec {
  font: 600 .92rem system-ui, sans-serif;
  padding: 10px 16px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.12); color: #fff;
  border: 1.5px solid rgba(255,255,255,.4); text-decoration: none;
}
.btn-sec:hover { background: rgba(255,255,255,.22); }
.btn-wa { background: var(--whatsapp); border-color: var(--whatsapp); }
.titolo-sez { margin: 0 0 14px; color: var(--verde); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge { font: 600 .85rem system-ui, sans-serif; background: var(--rosso); color: #fff; padding: 3px 12px; border-radius: 999px; }

.totali { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tot-blocco { background: #fff; border: 1.5px solid #ece3d3; border-radius: 10px; padding: 12px 14px; }
.tot-blocco h3 { margin: 0 0 8px; font-size: 1rem; color: var(--rosso-scuro); }
.tot-blocco ul { list-style: none; margin: 0; padding: 0; }
.tot-blocco li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dotted #e5dccb; }
.tot-blocco li:last-child { border-bottom: none; }
.tot-blocco li.zero { color: #aaa; }
.tot-num { font: 700 1rem system-ui, sans-serif; color: var(--verde-chiaro); white-space: nowrap; }
.tot-blocco li.zero .tot-num { color: #bbb; }

.tabella-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; border: 1.5px solid #ece3d3; }
.tabella { width: 100%; border-collapse: collapse; background: #fff; font-size: .95rem; }
.tabella th, .tabella td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid #f0e8da; }
.tabella th { background: var(--verde); color: #fff; font: 600 .85rem system-ui, sans-serif; white-space: nowrap; position: sticky; top: 0; }
.tabella tbody tr:nth-child(even) { background: #fcf8f1; }
.tabella td.nome { font-weight: bold; white-space: nowrap; }
.tabella td.num, .tabella td.data { color: var(--grigio); font-size: .85rem; white-space: nowrap; }
.tabella td.nessuno { color: #bbb; }
.tabella td.note { font-style: italic; color: #555; min-width: 140px; }
.btn-elimina { background: none; border: 1px solid #e0c9c9; color: var(--rosso); border-radius: 6px; cursor: pointer; padding: 2px 8px; }
.btn-elimina:hover { background: #ffe3e3; }
.vuoto-msg { color: var(--grigio); font-style: italic; text-align: center; padding: 20px 0; }
.aggiornato { color: var(--grigio); font-size: .82rem; margin: 10px 0 0; text-align: right; font-family: system-ui, sans-serif; }

@media print {
  body { background: #fff !important; color: #000; }
  .snow, .no-print, .footer { display: none !important; }
  .hero { color: #000; padding: 0 0 10px; }
  .hero h1 { text-shadow: none; font-size: 1.5rem; }
  .evento { color: #000; border-color: #999; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .tabella th { background: #eee !important; color: #000; }
  .tabella-wrap { overflow: visible; }
}
