/* Unser Advent – ruhiges Winterdesign (Nachtblau, Kerzengold, ein Hauch Schnee) */
:root {
  --bg-1: #0f1a2e;
  --bg-2: #1b2a47;
  --ink: #f3eee4;
  --muted: #b3bccd;
  --gold: #e0bd78;
  --gold-deep: #b98f45;
  --card: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.14);
  --ok: #9bd3a8;
  --err: #f0a3a3;
  --radius: 16px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg-2); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2) 600px);
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--gold); }
a:hover { color: #f1d9a3; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; }

/* Schnee: ruhig, nur CSS */
.snow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.55;
  background-image:
    radial-gradient(2px 2px at 20px 30px, #fff, transparent),
    radial-gradient(2px 2px at 120px 90px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 210px 160px, #fff, transparent),
    radial-gradient(2px 2px at 300px 40px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 60px 220px, #fff, transparent),
    radial-gradient(2px 2px at 260px 250px, #fff, transparent);
  background-size: 340px 300px;
  animation: snowfall 38s linear infinite;
}
@keyframes snowfall { from { background-position: 0 0; } to { background-position: 40px 600px; } }
@media (prefers-reduced-motion: reduce) { .snow { animation: none; } * { animation: none !important; transition: none !important; } }

.wrap { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 8px 18px 40px; }
.wrap-wide { max-width: 1080px; }
.footer { position: relative; z-index: 1; text-align: center; color: var(--muted); font-size: 14px; padding: 20px 0 30px; }

.topbar {
  position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 18px; padding: 14px 18px; padding-top: calc(14px + env(safe-area-inset-top));
  max-width: 1080px; margin: 0 auto;
}
.brand { font-family: var(--serif); font-size: 21px; color: var(--ink); text-decoration: none; letter-spacing: 0.3px; }
.topnav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 15px; }
.topnav a { color: var(--muted); text-decoration: none; }
.topnav a:hover { color: var(--gold); }
.nav-admin { border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; }
.inline { display: inline; margin: 0; }
.linklike { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.linklike:hover { color: var(--gold); }

.banner { position: relative; z-index: 2; text-align: center; background: #5a4520; color: #fbe9c4; padding: 8px 14px; font-size: 15px; }
.banner a { color: #fff; }

.hero { text-align: center; padding: 18px 0 8px; }
.hero-title, .page-title { font-family: var(--serif); font-size: clamp(34px, 7vw, 52px); text-align: center; margin: 10px 0 6px; letter-spacing: 0.5px; }
.page-title.left { text-align: left; font-size: clamp(26px, 5vw, 34px); }
.hero-sub { color: var(--muted); margin: 0 0 14px; font-family: var(--serif); font-size: 19px; }
.section-title { font-size: 22px; margin-top: 34px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow { color: var(--gold); font-size: 13px; text-transform: uppercase; letter-spacing: 1.6px; margin: 0 0 6px; }

/* Türchen-Raster */
.grid { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(6, 1fr); gap: 14px; } }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  aspect-ratio: 1 / 1; border-radius: 14px; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); background: var(--card);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.tile-num { font-family: var(--serif); font-size: 28px; line-height: 1; }
.tile-note { font-size: 12px; color: var(--muted); }
.tile-locked { opacity: 0.5; }
a.tile:hover { transform: translateY(-2px); border-color: var(--gold); }
.tile-new { border-color: var(--gold); background: rgba(224, 189, 120, 0.12); box-shadow: 0 0 18px rgba(224, 189, 120, 0.18); }
.tile-new .tile-note { color: var(--gold); }
.tile-opened { background: rgba(255, 255, 255, 0.03); }
.tile-opened .tile-note { color: var(--ok); }
.tile-today { animation: glow 3.4s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 14px rgba(224, 189, 120, 0.2); } 50% { box-shadow: 0 0 28px rgba(224, 189, 120, 0.45); } }

/* Karten & Text */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px; margin: 16px 0; }
.card-title { font-size: 22px; margin: 0 0 8px; }
.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--gold); }
.prose p { margin: 0 0 14px; font-family: var(--serif); font-size: 19px; line-height: 1.7; }
.prose p:last-child { margin-bottom: 0; }
.list { list-style: none; padding: 0; margin: 0; }

.door-head { text-align: center; margin: 6px 0 14px; }
.door-title { font-size: clamp(28px, 6vw, 40px); margin: 6px 0; }
.when { color: var(--gold); font-family: var(--serif); font-style: italic; margin: 4px 0 0; font-size: 19px; }
.chip { display: inline-block; font-size: 12px; text-transform: uppercase; letter-spacing: 1.4px; padding: 3px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.door-first .door-head, .door-first .card, .door-first .gallery { animation: openup 0.9s ease both; }
@keyframes openup { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }

.gallery { display: grid; gap: 10px; margin: 14px 0; }
.gallery-2, .gallery-4 { grid-template-columns: repeat(2, 1fr); }
.gallery-3 { grid-template-columns: repeat(2, 1fr); }
.gallery-3 figure:first-child { grid-column: 1 / -1; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid var(--line); }
.gallery figcaption { color: var(--muted); font-size: 14px; text-align: center; margin-top: 4px; font-family: var(--serif); font-style: italic; }
.thumb { max-width: 100%; max-height: 260px; border-radius: 12px; border: 1px solid var(--line); }
.thumb-sm { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }

.puzzle-q { font-family: var(--serif); font-size: 20px; margin: 6px 0 12px; }
.hint { color: var(--gold); font-style: italic; }
.options { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.option { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.option:hover { border-color: var(--gold); }
.voucher-text { font-family: var(--serif); font-size: 21px; color: #f6e3b4; }
.plain { padding-left: 18px; }

.door-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 26px; }
.door-nav .btn { white-space: nowrap; padding: 10px 14px; font-size: 15px; }

/* Formulare */
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: 15px; color: var(--muted); }
input[type=text], input[type=password], input[type=date], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
input[type=file] { color: var(--muted); font-size: 15px; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.check.big { font-size: 17px; padding: 14px; border: 1px dashed var(--gold); border-radius: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; display: grid; gap: 14px; }
.puzzle-section { display: grid; gap: 14px; }
.box legend { padding: 0 8px; color: var(--gold); }
.photo-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-bottom: 10px; }

.btn {
  display: inline-block; font: inherit; font-size: 16px; text-decoration: none; cursor: pointer; text-align: center;
  color: var(--ink); background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line);
  padding: 11px 20px; border-radius: 999px; min-height: 44px;
}
.btn:hover { border-color: var(--gold); color: var(--ink); }
.btn-gold { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: #2a1f08; border-color: transparent; font-weight: 600; }
.btn-gold:hover { color: #2a1f08; filter: brightness(1.06); }
.btn-ghost { background: transparent; }

.flashes { margin-top: 10px; }
.flash { border-radius: 12px; padding: 10px 14px; margin: 8px 0; border: 1px solid var(--line); background: var(--card); }
.flash-ok { border-color: var(--ok); color: var(--ok); }
.flash-error { border-color: var(--err); color: var(--err); }
.flash-hint { border-color: var(--gold); color: var(--gold); }

.login { max-width: 420px; margin: 40px auto; }

/* Admin (hell, nüchtern) */
.theme-admin { --ink: #1d2433; --muted: #5d667a; --gold: #8a6420; --gold-deep: #a5772a; --card: #fff; --line: #d9d5cc;
  --ok: #1f7a3a; --err: #a12626; background: #f5f2ec; }
html:has(.theme-admin) { background: #f5f2ec; }
.theme-admin .snow { display: none; }
.theme-admin a { color: #8a6420; }
.theme-admin .brand { color: #1d2433; }
.theme-admin input[type=text], .theme-admin input[type=password], .theme-admin input[type=date], .theme-admin select, .theme-admin textarea {
  background: #fff; color: var(--ink); }
.theme-admin .btn { background: #fff; }
.theme-admin .btn-gold { background: linear-gradient(180deg, #e8c47b, #cfa34f); color: #2a1f08; }
.theme-admin .flash-hint { color: #8a6420; }

.admin-grid { list-style: none; margin: 18px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.atile { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 12px; border-radius: 14px; border: 1px solid var(--line);
  background: #fff; text-decoration: none; color: var(--ink); }
.atile:hover { border-color: #cfa34f; }
.atile-top { display: flex; justify-content: space-between; align-items: baseline; }
.atile-num { font-family: var(--serif); font-size: 26px; }
.atile-date { color: var(--muted); font-size: 13px; }
.atile-title { font-size: 15px; min-height: 2.4em; }
.atile-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.atile-fertig { border-color: #8bc79b; }
.atile-leer { background: #faf8f4; }
.atile-today { box-shadow: 0 0 0 2px #cfa34f; }
.pill { font-size: 12px; padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: #faf8f4; }
.pill-fertig, .pill-ok { color: var(--ok); border-color: #8bc79b; }
.pill-entwurf { color: #8a6420; border-color: #e0bd78; }
.table { width: 100%; border-collapse: collapse; margin: 8px 0 20px; }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.editor { max-width: 760px; }

@media print {
  .snow, .topbar, .footer, .door-nav { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border: 0; background: none; break-inside: avoid; }
  .prose p, .eyebrow, .muted { color: #000; }
}
