/* =========================================================
   ADVENTSKALENDER – Design-System mit wechselbaren Themes
   Die eigentlichen Theme-Farben kommen zur Laufzeit aus der DB
   (Tabelle "themes") und werden von templates/header.php als
   Inline-<style>:root{...} nach diesem Stylesheet ausgegeben und
   überschreiben damit automatisch die Werte hier. Diese Werte
   hier sind nur der Fallback, falls die DB mal nicht erreichbar
   ist. Themes selbst verwaltet man unter Admin -> Themes.
   ========================================================= */

:root {
  --bg: #0b1220;
  --bg-deep: #060a14;
  --bg-glow: #16223b;
  --surface: #121b2e;
  --surface-2: #182338;
  --line: #26324a;
  --text: #f2eee3;
  --text-muted: #9aa4bd;
  --gold: #d8b878;
  --gold-bright: #f0d29d;
  --frost: #7fb8c4;
  --ok: #8fbf8a;
  --error: #e08a8a;

  --font-display: 'Fraunces', 'Iowan Old Style', 'Georgia', serif;
  --font-body: 'Sora', 'Segoe UI', system-ui, sans-serif;
  --font-num: 'Space Grotesk', 'Sora', sans-serif;

  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px -20px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

@keyframes page-fade-in { from { opacity: 0; } to { opacity: 1; } }
body { animation: page-fade-in 0.35s ease; }
@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
}

body {
  margin: 0;
  background-color: var(--bg-deep);
  background-image: radial-gradient(ellipse 120% 70% at 50% -10%, var(--bg-glow) 0%, var(--bg) 55%, transparent 100%);
  background-repeat: no-repeat;
  background-size: 100% 900px;
  background-position: top center;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  position: relative;
  overflow-x: hidden;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
  margin: 0 0 0.4em;
}

a { color: var(--frost); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--gold); color: #1a1206; }

/* ---------- Schnee-Ambiente (dezent, kein Overload) ---------- */
#snow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ---------- Layout ---------- */
.page {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
  font-family: var(--font-num);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
}

.topbar a.link-quiet {
  color: var(--text-muted);
  border-bottom: 1px dashed var(--line);
}
.topbar a.link-quiet:hover { color: var(--frost); text-decoration: none; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-main { display: flex; align-items: center; gap: 16px; }
.nav-admin {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  font-size: 0.95rem;
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.icon-link:hover { opacity: 1; background: rgba(255,255,255,0.06); }

/* ---------- Karten / Panels ---------- */
.card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.card + .card { margin-top: 18px; }

.eyebrow {
  font-family: var(--font-num);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-card .display { font-size: 1.7rem; }
.login-card p { color: var(--text-muted); margin-bottom: 22px; }

/* ---------- Formulare ---------- */
label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 14px 0 6px;
}
label:first-child { margin-top: 0; }

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 120px; resize: vertical; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(216,184,120,0.18);
}

.help { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
}
.btn-primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #211705;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -8px rgba(216,184,120,0.5); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--frost); color: var(--frost); }
.btn-danger {
  background: transparent;
  border: 1px solid #6b3838;
  color: var(--error);
}
.btn-danger:hover { background: rgba(224,138,138,0.1); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }

.error-box {
  background: rgba(224,138,138,0.1);
  border: 1px solid #6b3838;
  color: var(--error);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}
.success-box {
  background: rgba(143,191,138,0.1);
  border: 1px solid #3d5b3a;
  color: var(--ok);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

/* ---------- Kalender-Grid ---------- */
.calendar-intro { text-align: center; margin-bottom: 30px; }
.calendar-intro .display { font-size: 2rem; }
.calendar-intro p { color: var(--text-muted); }

.door-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (min-width: 520px) {
  .door-grid { grid-template-columns: repeat(6, 1fr); gap: 14px; }
}

.door {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-num);
  font-size: 1.3rem;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  isolation: isolate;
  overflow: hidden;
}

.door.is-empty { opacity: 0.35; }

.door.is-locked {
  color: var(--text-muted);
}
.door.is-locked::after {
  content: "❄";
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 0.7rem;
  opacity: 0.5;
}

.door.is-open {
  background: linear-gradient(160deg, #1c2740, var(--surface));
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow: 0 0 0 1px rgba(216,184,120,0.25), 0 12px 24px -10px rgba(216,184,120,0.35);
}
.door.is-open:hover { transform: translateY(-2px); text-decoration: none; }

.door.is-solved {
  background: linear-gradient(160deg, #2a2410, #1c2740);
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}
.door.is-solved::before {
  content: "★";
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.65rem;
  color: var(--gold-bright);
}

a.door { text-decoration: none; }

/* ---------- Türchen-Detail ---------- */
.riddle-image, .sticker-image, .option-image img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  display: block;
  margin: 14px 0;
}

.riddle-audio {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 14px 0;
}
.riddle-audio-icon { font-size: 1.3rem; flex-shrink: 0; }
.riddle-audio audio {
  width: 100%;
  height: 40px;
  /* Native Player einfärben, wo der Browser es zulässt (Firefox/Chrome) */
  accent-color: var(--gold);
  border-radius: 999px;
}

.riddle-text {
  font-size: 1.05rem;
  white-space: pre-wrap;
}

/* ---------- Tipp (erscheint erst ab der eingestellten Uhrzeit) ---------- */
.hint-box {
  margin-top: 18px;
  border: 1px dashed var(--gold);
  border-radius: var(--radius-sm);
  background: rgba(216, 184, 120, 0.06);
  padding: 4px 14px;
}
.hint-box summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 2px;
  color: var(--gold-bright);
  font-weight: 500;
  user-select: none;
}
.hint-box summary::-webkit-details-marker { display: none; }
.hint-box summary::before { content: "▸ "; display: inline-block; transition: transform 0.2s ease; }
.hint-box[open] summary::before { transform: rotate(90deg); }
.hint-box-content {
  padding: 2px 2px 14px;
  color: var(--text);
  white-space: pre-wrap;
  animation: hint-reveal 0.35s ease;
}
@keyframes hint-reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  text-align: center;
  padding-top: 6px;
}
.reveal .eyebrow { color: var(--ok); }
.reveal .package-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold-bright);
  margin: 4px 0 14px;
}
.reveal .sticker-image { max-width: 260px; margin-left: auto; margin-right: auto; }

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.option-card {
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-deep);
  padding: 0;
}
.option-card img { width: 100%; display: block; aspect-ratio: 1/1; object-fit: cover; }
.option-card.selected { border-color: var(--gold); }
.option-card button {
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.option-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 4px;
}

/* ---------- Reihenfolge-Rätsel (sequence) ---------- */
.sequence-list {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sequence-list li {
  display: flex;
  align-items: stretch;
  gap: 12px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
}
.sequence-thumb {
  position: relative;
  flex: 1;
  min-width: 0;
  aspect-ratio: 4 / 3;
  max-height: 280px;
  border-radius: 10px;
  overflow: hidden;
}
.sequence-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sequence-position {
  position: absolute;
  top: 8px;
  left: 8px;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: var(--bg-deep);
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 1rem;
  border-radius: 999px;
  border: 2px solid var(--bg-deep);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.sequence-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  justify-content: center;
}
.sequence-controls button {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  width: 48px;
  height: 48px;
  cursor: pointer;
  font-size: 1.1rem;
}
.sequence-controls button:hover { border-color: var(--gold); }

/* ---------- Karten-Rätsel (map) ---------- */
.puzzle-map {
  width: 100%;
  height: 340px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  margin: 10px 0;
}
.admin-map {
  width: 100%;
  height: 320px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  margin: 10px 0;
}

.locked-note {
  text-align: center;
  color: var(--text-muted);
  padding: 30px 10px;
}
.locked-note .big-date {
  font-family: var(--font-num);
  font-size: 1.4rem;
  color: var(--frost);
  margin: 10px 0;
}

/* ---------- Admin ---------- */
.admin-badge {
  display: inline-block;
  font-family: var(--font-num);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(216,184,120,0.15);
  color: var(--gold);
  border: 1px solid rgba(216,184,120,0.4);
  padding: 3px 10px;
  border-radius: 999px;
}

.admin-only-tag {
  display: inline-block;
  font-family: var(--font-num);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(127,184,196,0.12);
  color: var(--frost);
  border: 1px solid rgba(127,184,196,0.35);
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}

.debug-banner {
  background: repeating-linear-gradient(135deg, #3a2a12, #3a2a12 10px, #2b1e0d 10px, #2b1e0d 20px);
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.85rem;
  margin-bottom: 18px;
  text-align: center;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.tabs a {
  padding: 10px 16px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  font-size: 0.92rem;
}
.tabs a.active {
  color: var(--gold-bright);
  border-color: var(--gold);
}
.tabs a:hover { text-decoration: none; color: var(--frost); }

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.admin-table th, table.admin-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
table.admin-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ---------- Tage-Liste (Karten statt Tabelle - robust auf jeder Breite) ---------- */
.day-list { display: flex; flex-direction: column; }
.day-item {
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
}
.day-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.day-item-day {
  font-family: var(--font-num);
  font-weight: 600;
  min-width: 58px;
}
.day-item-type {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: auto;
}
.day-item-title {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 12px;
}

.status-pill {
  display: inline-block;
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-num);
}
.status-pill.ok { background: rgba(143,191,138,0.15); color: var(--ok); }
.status-pill.missing { background: rgba(224,138,138,0.15); color: var(--error); }

.row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-actions form { display: inline; }

.mini-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.85rem;
}
.mini-form select { padding: 6px 8px; }

.more-actions {
  width: 100%;
  margin-top: 4px;
}
.more-actions summary {
  cursor: pointer;
  list-style: none;
  color: var(--frost);
  font-size: 0.88rem;
  padding: 8px 4px;
  user-select: none;
}
.more-actions summary::-webkit-details-marker { display: none; }
.more-actions summary:hover { text-decoration: underline; }
.more-actions[open] summary { margin-bottom: 6px; }
.more-actions .mini-form {
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 8px;
}
.more-actions .mini-form:last-child { margin-bottom: 0; }

.admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row > div { flex: 1; min-width: 180px; }

.image-preview-current {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}
.image-preview-current img {
  width: 70px; height: 70px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line);
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px 18px;
  margin: 20px 0;
}
fieldset legend {
  padding: 0 8px;
  font-family: var(--font-num);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
}

/* ---------- Theme-Auswahl ---------- */
.theme-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.theme-option input { margin: 0; }
.theme-option.is-active,
.theme-option:has(input:checked) { border-color: var(--gold); }
.theme-swatch { display: flex; gap: 3px; }
.swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
}
.theme-label { font-size: 0.88rem; }

/* ---------- Theme-Liste (admin/themes.php) ---------- */
.theme-list { display: flex; flex-direction: column; margin-top: 10px; }
.theme-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 8px;
  border-bottom: 1px solid var(--line);
}
.theme-row.is-active { background: rgba(216,184,120,0.05); }
.theme-row-name { font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }
.theme-row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.theme-row-actions .btn { padding: 7px 12px; font-size: 0.82rem; }

/* ---------- Farbeditor ---------- */
.color-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.color-field label { font-size: 0.8rem; }
.color-field-row { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.color-field-row input[type="color"] {
  width: 42px;
  height: 38px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-deep);
  cursor: pointer;
}
.hex-input { font-family: var(--font-num); font-size: 0.85rem; }

/* ---------- Live-Vorschau im Editor ---------- */
.theme-preview-box {
  border-radius: var(--radius);
  padding: 24px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.theme-preview-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  color: var(--text);
  font-family: var(--font-body);
}
.theme-preview-eyebrow {
  font-family: var(--font-num);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.theme-preview-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 16px;
}
.theme-preview-door {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  font-family: var(--font-num);
  font-size: 1.3rem;
  margin-bottom: 16px;
}
.theme-preview-btn {
  display: block;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: var(--bg-deep);
  font-weight: 600;
  cursor: default;
}

.option-editor-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.option-editor-row img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }

.footer-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 40px;
}

/* ---------- Icon-Symbole (Enthüllung / Formular / Druck-Übersicht) ---------- */
:root { --icon-size: 5rem; }

.icon-symbol-preview {
  font-size: 2.6rem;
  line-height: 1;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  flex-shrink: 0;
}

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--icon-size) * 1.35);
  height: calc(var(--icon-size) * 1.35);
  background: #ffffff;
  color: #14100a;
  border: calc(var(--icon-size) * 0.045) solid #14100a;
  border-radius: 22%;
  font-size: var(--icon-size);
  line-height: 1;
  box-shadow: 0 10px 24px -10px rgba(0,0,0,0.5);
}

.reveal .icon-badge { margin: 10px auto 6px; }

/* ---------- Jahres-Dashboard ---------- */
.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 6px;
}
.year-card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px;
  position: relative;
}
.year-card.is-active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(216,184,120,0.25);
}
.year-card .year-number {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold-bright);
}
.year-card .year-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 6px 0 12px;
}
.progress-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-deep);
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transition: width 0.4s ease;
}
.year-card .year-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.year-card .year-actions .btn { padding: 7px 12px; font-size: 0.82rem; }

/* ---------- Live-Countdown (nächstes Türchen) ---------- */
.countdown-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}
.countdown-door-badge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 1.3rem;
}
.countdown-door-badge span {
  position: absolute;
  font-family: var(--font-num);
  font-size: 0.95rem;
  color: var(--gold-bright);
  background: var(--surface);
  border-radius: 999px;
  padding: 0 5px;
  bottom: -6px;
  right: -6px;
  border: 1px solid var(--line);
}
.countdown-sub { font-size: 0.82rem; color: var(--text-muted); }

.countdown-display {
  display: flex;
  gap: 18px;
  margin-top: 10px;
}
.countdown-display > div {
  text-align: center;
}
.countdown-display span {
  display: block;
  font-family: var(--font-num);
  font-size: 1.9rem;
  color: var(--gold-bright);
  line-height: 1.1;
}
.countdown-display small {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}
.countdown-daybar {
  height: 5px;
  border-radius: 999px;
  background: var(--bg-deep);
  overflow: hidden;
  margin-top: 16px;
}
.cd-daybar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--frost), var(--gold-bright));
  transition: width 1s linear;
}
.countdown.is-due { display: none; }

/* ---------- Icon-Druckübersicht ---------- */
.icon-print-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}
.icon-print-cell {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 10px;
  text-align: center;
  background: var(--surface);
}
.icon-print-cell .icon-badge { margin: 6px auto 10px; }
.icon-print-cell .print-day { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

@media print {
  body { background: #fff !important; color: #000 !important; }
  #snow, .topbar, .tabs, .btn, .no-print { display: none !important; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; background: #fff !important; }
  .icon-print-cell { border: 1px solid #999 !important; background: #fff !important; color: #000 !important; }
  .icon-print-cell .print-day { color: #000 !important; }
}

@media (max-width: 480px) {
  .page { padding: 20px 14px 60px; }
  .card { padding: 20px 16px; }
  .option-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .topbar span { line-height: 1.8; }

  table.admin-table { font-size: 0.85rem; }
  table.admin-table th, table.admin-table td { padding: 8px 6px; }

  .day-item-type { margin-left: 0; }

  .row-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .row-actions > a.btn,
  .row-actions > form > .btn {
    width: 100%;
    text-align: center;
  }
  .mini-form {
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-deep);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px;
  }
  .mini-form label { margin: 4px 0 0 !important; }
  .mini-form select { width: 100%; }
}

/* ---------- Toast-Benachrichtigungen ---------- */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ok);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.is-visible { opacity: 1; transform: translateX(0); }
.toast.toast-error { border-left-color: var(--error); }

/* ---------- Button-Ladezustand ---------- */
.btn.is-loading { cursor: default; opacity: 0.85; }
.btn-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: 0.75;
  animation: btn-spin 0.6s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
  .btn-spinner { animation: none; }
}

/* ---------- Bestätigungs-Modal (statt Browser-confirm) ---------- */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.confirm-overlay.is-visible { opacity: 1; pointer-events: auto; }
.confirm-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  max-width: 360px;
  width: 100%;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.18s ease;
}
.confirm-overlay.is-visible .confirm-box { transform: translateY(0) scale(1); }
.confirm-message {
  margin: 0 0 20px;
  color: var(--text);
  font-size: 0.98rem;
}
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- Konsistente Fokus-Zustände (Tastatur-Navigation) ----------
   Inputs/Selects/Textareas haben weiter oben bereits einen eigenen,
   box-shadow-basierten Fokus-Ring (passend zum Theme) - hier bewusst nicht
   verdoppeln, nur die "nackten" interaktiven Elemente bekommen den
   generischen goldenen Outline-Ring. */
a, button, summary {
  outline-color: var(--gold-bright);
}
a:focus-visible,
button:focus-visible,
summary:focus-visible,
.door:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn:focus-visible { outline-offset: 3px; }

/* ---------- Bildsuche (Rätsel-Typ "point") ---------- */
.point-wrap {
  position: relative;
  display: block;
  width: 100%;
  margin: 10px 0;
}
.point-wrap img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  cursor: crosshair;
  user-select: none;
}
.point-marker {
  position: absolute;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  margin-top: -13px;
  border-radius: 50%;
  border: 3px solid var(--gold-bright);
  background: rgba(240, 210, 157, 0.22);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.45);
  pointer-events: none;
}

/* ---------- Async-Upload-Slots (sofortiger Einzel-Upload) ---------- */
.async-upload {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.async-upload-preview {
  display: flex;
  align-items: center;
}
.async-upload-preview img {
  max-width: 140px;
  max-height: 140px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  object-fit: cover;
  display: block;
}
.async-upload-preview audio { width: 100%; max-width: 300px; height: 38px; }
.async-upload-status {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-height: 1.1em;
}
.async-upload-status.is-loading { color: var(--frost); }
.async-upload-status.is-success { color: var(--ok); }
.async-upload-status.is-error { color: var(--error); }
