@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Creepster";
  src: url("/fonts/creepster-latin-400-normal.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Permanent Marker";
  src: url("/fonts/permanent-marker-latin-400-normal.woff2") format("woff2");
  font-display: swap;
}

/* Theme-Variablen (--bg, --fg, --accent, --muted, --surface, --moon, Fonts) setzt das Layout pro Party. */
:root {
  --radius: 8px;
  --line: color-mix(in srgb, var(--fg) 14%, transparent);
  --gutter: 16px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body), system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.45;
  min-height: 100dvh;
  overflow-x: hidden;
}

a {
  color: var(--accent);
}

.wrap {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
  padding: 48px var(--gutter) 32px;
}
.wrap.wide {
  max-width: 1100px;
}

/* ---------- Mond mit Fledermäusen ---------- */
.moon {
  position: absolute;
  top: -150px;
  right: -110px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: var(--moon);
  border: 3px solid var(--accent);
  pointer-events: none;
  z-index: 0;
}
.bat {
  position: absolute;
  fill: var(--accent);
  pointer-events: none;
}
.bat.b1 { width: 52px; top: 22px; right: 54px; }
.bat.b2 { width: 30px; top: 92px; right: 16px; }
.bat.b3 { width: 32px; top: 8px; right: 168px; }
@media (min-width: 720px) {
  .moon { top: -180px; right: -120px; width: 420px; height: 420px; }
  .bat.b1 { width: 70px; top: 50px; right: 110px; }
  .bat.b2 { width: 40px; top: 150px; right: 40px; }
  .bat.b3 { width: 40px; top: 18px; right: 290px; }
}
main,
header,
footer {
  position: relative;
  z-index: 1;
}

/* ---------- Typo wie auf dem Flyer ---------- */
.kicker {
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.82rem;
  margin: 0 0 12px;
}
.title {
  font-family: var(--font-title), serif;
  font-weight: 400;
  font-size: clamp(3.6rem, 19vw, 7rem);
  line-height: 0.92;
  margin: 0;
  letter-spacing: 0.01em;
}
.title .accent {
  display: block;
  color: var(--accent);
  font-size: 0.62em;
}
.tagline {
  font-family: var(--font-tagline), cursive;
  font-size: clamp(1.15rem, 5vw, 1.6rem);
  transform: rotate(-2.5deg);
  transform-origin: left;
  margin: 18px 0 26px;
}
h1, h2, h3 {
  line-height: 1.15;
}
h1.page {
  font-family: var(--font-title), serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 12vw, 4rem);
  margin: 0 0 8px;
  color: var(--fg);
}
h2 {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--accent);
  margin: 32px 0 12px;
}
.date {
  font-size: clamp(1.7rem, 8vw, 2.4rem);
  font-weight: 800;
  margin: 0;
}
.doors {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 4px 0;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.9rem;
}

/* ---------- Programm ---------- */
.program {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}
.program li {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: baseline;
}
.program .no {
  font-family: var(--font-title), serif;
  color: var(--accent);
  font-size: 2.1rem;
  line-height: 1;
}
.program strong {
  display: block;
  font-size: 1.25rem;
}

/* ---------- Bausteine ---------- */
.stack > * + * {
  margin-top: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card.hot {
  border-color: var(--accent);
}
.badge {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 1.1rem;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.spread {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 22px;
  border-radius: 6px;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  font: 800 1rem/1.1 var(--font-body), sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  cursor: pointer;
}
.btn.block {
  display: flex;
  width: 100%;
}
.btn.ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line);
}
.btn.small {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.8rem;
}
.btn.danger {
  background: transparent;
  color: #ff8a80;
  border-color: #ff8a8066;
}
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.chip input:focus-visible + span {
  outline: 3px solid var(--fg);
  outline-offset: 2px;
}

/* ---------- Formulare ---------- */
label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
input[type="text"],
textarea,
select {
  width: 100%;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  min-height: 50px;
}
textarea {
  min-height: 110px;
  resize: vertical;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}
legend {
  font-weight: 600;
  margin-bottom: 8px;
  padding: 0;
}
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  position: relative;
}
.chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 600;
  user-select: none;
}
.chip input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.check {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 400;
}
.check input {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

/* ---------- Namensliste ---------- */
.names {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.names button {
  min-height: 56px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  font: 600 1.05rem var(--font-body), sans-serif;
  cursor: pointer;
}
.names button:active {
  background: var(--accent);
  color: var(--bg);
}

/* ---------- Award ---------- */
.candidates {
  display: grid;
  gap: 14px;
}
.cand {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 14px;
  align-items: center;
}
.cand .pic {
  width: 84px;
  height: 84px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg);
  display: grid;
  place-items: center;
  font-family: var(--font-title), serif;
  font-size: 2rem;
  color: var(--accent);
}
.cand .who strong {
  display: block;
  font-size: 1.15rem;
}
.cand .choices {
  grid-column: 1 / -1;
  gap: 6px;
}
.cand .chip span {
  padding: 8px 14px;
}
.sticky-submit {
  position: sticky;
  bottom: 0;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 30%);
}

.winner {
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.winner .no {
  font-family: var(--font-title), serif;
  color: var(--accent);
  font-size: 1.8rem;
  min-width: 2ch;
}

.notice {
  border-left: 4px solid var(--accent);
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 0 6px 6px 0;
}
.error {
  border-left-color: #ff8a80;
}

/* ---------- Tabellen (Admin) ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
td form {
  display: inline;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.stat b {
  display: block;
  font-size: 2rem;
  line-height: 1;
  font-weight: 800;
}
.stat span {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- Mario Kart ---------- */
.rounds {
  display: grid;
  gap: 24px;
}
.races {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.race ol {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.race li {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.race li.adv {
  color: var(--accent);
  font-weight: 800;
}
.race li.adv::after {
  content: "  weiter";
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.champion {
  text-align: center;
  padding: 24px;
}
.champion .name {
  font-family: var(--font-title), serif;
  font-size: clamp(2.6rem, 12vw, 5rem);
  color: var(--accent);
  line-height: 1;
}

/* ---------- Footer ---------- */
.foot {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.foot a {
  color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  .fade {
    animation: fade 0.4s ease-out both;
  }
  @keyframes fade {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
  }
}

/* ---------- Abstände ---------- */
.mt { margin-top: 24px; }
.mt-s { margin-top: 8px; }
.mt-0 { margin-top: 0; }

/* ---------- Musik ---------- */
.song {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
}
.song img,
.song .cover {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--surface);
}
.song .who {
  min-width: 0;
}
.song .who strong,
.song .who span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
form.row[role="search"] {
  flex-wrap: nowrap;
}
form.row[role="search"] .btn.block {
  width: auto;
  flex: none;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
ul.plain {
  list-style: none;
  margin: 0;
  padding: 0;
}
ul.plain li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

/* ---------- Galerie ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.gallery figure {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.gallery figure.winner-pic {
  border-color: var(--accent);
}
.gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}
.gallery figcaption {
  padding: 10px;
  display: grid;
  gap: 4px;
}
.award-tag {
  justify-self: start;
  background: var(--accent);
  color: var(--bg);
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 4px;
}
