@font-face { font-family: "Nunito"; src: url("../schrift/nunito-var.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Mountains of Christmas"; src: url("../schrift/mountains-of-christmas-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --rot: #c8102e; --dunkelrot: #960c22; --tanne: #0f6b3c; --gold: #ffd75e; --schnee: #f7fbff; --creme: #fff9ec;
  --nacht: #16233f; --grau: #5d6a85; --linie: 2.5px solid var(--nacht); --schatten: 4px 4px 0 rgba(22, 35, 63, 0.85);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #edf3fc; color: var(--nacht); font: 500 15px/1.45 "Nunito", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
#karte { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; outline: none; }
#karte.zieht { cursor: grabbing; }
#karte:focus-visible { box-shadow: inset 0 0 0 3px var(--gold); }

/* ---------- Seitenleiste ---------- */
.leiste { position: fixed; left: 14px; top: 14px; width: 304px; max-height: calc(100% - 28px); display: flex; flex-direction: column;
  background: var(--creme); border: var(--linie); border-radius: 22px; box-shadow: var(--schatten); overflow: hidden; }
.kopf { position: relative; padding: 20px 16px 22px; text-align: center; color: #fff;
  background: repeating-linear-gradient(135deg, var(--rot) 0 18px, var(--dunkelrot) 18px 36px); }
.kopf::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 14px;
  background: radial-gradient(circle at 12px -2px, transparent 11px, var(--creme) 12px) 0 0 / 24px 14px repeat-x; }
.kopf h1, .laderkarte h1 { margin: 0; font: 700 29px/1.05 "Mountains of Christmas", serif; letter-spacing: 0.3px; text-shadow: 2px 2px 0 rgba(22, 35, 63, 0.55); }
.kopf h1 b, .laderkarte h1 b { color: var(--gold); font-weight: 700; }
.kopf p { margin: 4px 0 0; font-weight: 800; font-size: 13px; letter-spacing: 0.4px; opacity: 0.95; }
.stern { color: var(--gold); }
.lichter { position: absolute; left: 0; right: 0; top: 0; height: 12px;
  background: radial-gradient(circle, #ffe37a 3.2px, transparent 4px) 0 3px / 44px 12px repeat-x, radial-gradient(circle, #7fe3ff 3.2px, transparent 4px) 22px 5px / 44px 12px repeat-x; }
.inhalt { overflow: auto; padding: 8px 12px 12px; overscroll-behavior: contain; }
.titelzeile { display: flex; align-items: center; justify-content: space-between; margin: 8px 2px 6px; }
h2 { margin: 0; font: 700 21px/1 "Mountains of Christmas", serif; color: var(--rot); }
.klein { border: 2px solid var(--nacht); background: #fff; border-radius: 999px; padding: 2px 10px; font-weight: 800; font-size: 12px; }
.klein:hover { background: var(--gold); }

.maerkte { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 7px; }
.markt { display: flex; align-items: center; gap: 4px; padding: 3px 6px 3px 2px; text-align: left; background: #fff; border: 2px solid var(--nacht); border-radius: 14px;
  box-shadow: 2px 2px 0 rgba(22, 35, 63, 0.85); transition: transform 0.12s, background 0.12s; min-width: 0; }
.markt img { width: 46px; height: 46px; object-fit: contain; flex: none; }
.mtext { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.mtext strong { font-weight: 900; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtext small { color: var(--grau); font-weight: 700; font-size: 11.5px; }
.markt:hover, .markt:focus-visible { transform: translate(-1px, -1px); background: #fff3c9; }
.markt.hier { background: var(--gold); }

.kategorien { display: flex; flex-direction: column; gap: 6px; }
.kat { display: flex; align-items: center; gap: 8px; width: 100%; padding: 2px 10px 2px 4px; text-align: left; border-radius: 14px; border: 2px solid var(--nacht);
  background: color-mix(in srgb, var(--farbe) 20%, #fff); box-shadow: 2px 2px 0 rgba(22, 35, 63, 0.85); transition: transform 0.12s, opacity 0.15s, background 0.15s; }
.kat img { width: 40px; height: 40px; object-fit: contain; flex: none; transition: filter 0.15s; }
.kname { flex: 1; font-weight: 800; }
.zahl { min-width: 30px; text-align: center; font-weight: 900; font-size: 12.5px; color: #fff; background: var(--farbe); border-radius: 999px; padding: 1px 7px; border: 2px solid var(--nacht); }
.kat:hover, .kat:focus-visible { transform: translate(-1px, -1px); }
.kat:not(.an) { background: #eef0f4; box-shadow: none; border-color: #a9b1c2; color: #8b93a6; }
.kat:not(.an) img { filter: grayscale(1) opacity(0.45); }
.kat:not(.an) .zahl { background: #c3c9d6; border-color: #a9b1c2; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Detailkarte ---------- */
.detail { position: fixed; right: 14px; top: 14px; width: 348px; max-height: calc(100% - 60px); overflow: auto; overscroll-behavior: contain;
  background: var(--creme); border: var(--linie); border-radius: 22px; box-shadow: var(--schatten); animation: rein 0.22s ease-out; }
.detail[hidden] { display: none; }
@keyframes rein { from { transform: translateY(10px); opacity: 0; } }
.dkopf { height: 168px; display: flex; align-items: flex-end; justify-content: center; padding: 14px 14px 0;
  background: radial-gradient(120% 90% at 50% 100%, #fff 0 34%, transparent 35%), linear-gradient(color-mix(in srgb, var(--farbe) 55%, #fff), color-mix(in srgb, var(--farbe) 22%, #fff)); }
.dbild { max-width: 76%; max-height: 150px; filter: drop-shadow(3px 4px 0 rgba(22, 35, 63, 0.25)); }
.zu { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border-radius: 50%; border: var(--linie); background: #fff; font-size: 22px; line-height: 1; font-weight: 800; box-shadow: 2px 2px 0 rgba(22, 35, 63, 0.85); }
.zu:hover { background: var(--gold); }
.dtitel { padding: 10px 16px 0; }
.marke { display: inline-block; background: var(--farbe); color: #fff; font-weight: 900; font-size: 11.5px; letter-spacing: 0.5px; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; border: 2px solid var(--nacht); }
.dtitel h2 { margin: 7px 0 2px; font-size: 30px; line-height: 1.02; color: var(--nacht); overflow-wrap: anywhere; }
.betreiber { margin: 0; font-weight: 800; color: var(--grau); }
.ort { margin-top: 8px; border: 0; background: none; padding: 0; font-weight: 800; color: var(--tanne); text-decoration: underline; text-underline-offset: 3px; }
.dtext { padding: 6px 16px 16px; }
.dtext p { margin: 8px 0; }
.dtext h3 { margin: 12px 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--rot); }
.leise { color: var(--grau); }
.programm { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.programm li { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; background: #fff; border: 2px solid var(--nacht); border-radius: 12px; padding: 6px 10px; }
.programm time { grid-row: span 2; align-self: center; font-weight: 900; font-size: 12px; color: var(--rot); white-space: nowrap; }
.programm span { color: var(--grau); font-size: 13px; }
figure { margin: 12px 0 0; }
figure img { display: block; width: 100%; border-radius: 12px; border: var(--linie); background: #dfe6f4; min-height: 80px; }
figcaption { font-size: 11.5px; color: var(--grau); margin-top: 3px; }
.knopf { display: inline-block; margin-top: 12px; padding: 8px 18px; border-radius: 999px; background: var(--tanne); color: #fff; font-weight: 900; text-decoration: none; border: var(--linie); box-shadow: 3px 3px 0 rgba(22, 35, 63, 0.85); }
.knopf:hover { background: #0c5a32; transform: translate(-1px, -1px); }

/* ---------- Kleinteile ---------- */
.tipp { position: fixed; left: 0; top: 0; pointer-events: none; max-width: 240px; padding: 5px 12px; background: #fff; border: 2.5px solid var(--farbe, var(--nacht)); border-radius: 14px;
  box-shadow: 3px 3px 0 rgba(22, 35, 63, 0.75); text-align: center; line-height: 1.2; z-index: 3; }
.tipp[hidden] { display: none; }
.tipp strong { display: block; font-weight: 900; }
.tipp span { font-size: 12.5px; color: var(--grau); font-weight: 700; }
.zoom { position: fixed; right: 14px; bottom: 34px; display: flex; flex-direction: column; gap: 8px; }
.zoom button { width: 44px; height: 44px; border-radius: 14px; border: var(--linie); background: #fff; font-size: 26px; font-weight: 800; line-height: 1; box-shadow: 3px 3px 0 rgba(22, 35, 63, 0.85); }
.zoom button:hover { background: var(--gold); }
.zoom button, .mobilbar button { display: flex; align-items: center; justify-content: center; }
.ort.sucht { animation: sucht 1s ease-in-out infinite; }
.ort.aktiv, .zoom .ort.aktiv:hover { background: #2f6fde; color: #fff; }
@keyframes sucht { 50% { background: #cfe0ff; } }
.hinweis { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); max-width: min(440px, calc(100% - 24px)); padding: 10px 16px; z-index: 6; text-align: center; font-weight: 800;
  background: #fff; border: var(--linie); border-radius: 16px; box-shadow: var(--schatten); }
.hinweis[hidden] { display: none; }
.quelle { position: fixed; right: 8px; bottom: 6px; font-size: 11px; color: #4a5672; background: rgba(255, 255, 255, 0.78); padding: 1px 8px; border-radius: 999px; max-width: calc(100% - 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quelle a { color: inherit; }

.lader { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; transition: opacity 0.6s;
  background: radial-gradient(circle at 20% 15%, #fff 1.5px, transparent 2.5px) 0 0 / 90px 90px, radial-gradient(circle at 70% 60%, #fff 2px, transparent 3px) 0 0 / 130px 130px, linear-gradient(#b3122d, #7d0a1f); }
.lader.weg { opacity: 0; pointer-events: none; }
.laderkarte { text-align: center; color: #fff; padding: 24px; }
.laderkarte h1 { font-size: clamp(34px, 7vw, 56px); }
.laderstern { font-size: 56px; color: var(--gold); line-height: 1; animation: dreh 2.4s ease-in-out infinite; }
@keyframes dreh { 50% { transform: scale(1.15) rotate(18deg); } }
.laderkarte p { font-weight: 800; margin: 12px 0 14px; }
.laderkarte p.fehler { background: #fff; color: var(--rot); padding: 8px 12px; border-radius: 12px; }
.balken { width: min(320px, 70vw); height: 16px; margin: 0 auto; border-radius: 999px; background: rgba(255, 255, 255, 0.25); border: 2px solid #fff; overflow: hidden; }
.balken i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(135deg, #fff 0 10px, var(--gold) 10px 20px); transition: width 0.25s; }

/* ---------- Schmale Bildschirme: Leiste unten ---------- */
.mobilbar, .griff, .mobilkopf { display: none; }

/* ---------- Schmale Bildschirme: zwei Knoepfe unten, die je ein Blatt mit grossen Kacheln oeffnen ---------- */
@media (max-width: 699px) {
  .leiste .kopf { display: none; }
  .mobilkopf { display: block; position: fixed; left: 0; right: 0; top: 0; padding: 12px; padding-top: calc(12px + env(safe-area-inset-top)); border-bottom: 2.5px solid var(--nacht); z-index: 2; }
  .mobilkopf::after { display: none; }
  .mobilkopf h1 { font-size: 22px; }
  .mobilbar { display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; padding: 8px 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 2; pointer-events: none; }
  .mobilbar button { pointer-events: auto; flex: 1; min-height: 48px; border-radius: 16px; border: var(--linie); background: #fff; font-weight: 900; font-size: 16px; box-shadow: 3px 3px 0 rgba(22, 35, 63, 0.85); display: flex; align-items: center; justify-content: center; gap: 8px; }
  .mobilbar #mbHeim, .mobilbar #mbOrt { flex: none; width: 48px; font-size: 22px; }
  .hinweis { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .mobilbar button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(22, 35, 63, 0.85); }
  .mbzahl { background: var(--tanne); color: #fff; border-radius: 999px; padding: 1px 9px; font-size: 13px; border: 2px solid var(--nacht); }
  #mbFilter.gefiltert { background: var(--gold); }
  #mbFilter.gefiltert .mbzahl { background: var(--rot); }

  .leiste { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 70%; border-radius: 22px 22px 0 0; border-width: 2.5px 0 0; box-shadow: 0 -4px 0 rgba(22, 35, 63, 0.25);
    padding-bottom: env(safe-area-inset-bottom); z-index: 3; overflow: visible; transform: translateY(105%); transition: transform 0.24s ease-out; visibility: hidden; }
  .leiste.offen { transform: none; visibility: visible; }
  .leiste[data-blatt="maerkte"] #abFilter, .leiste[data-blatt="filter"] #abMaerkte { display: none; }
  .inhalt { position: relative; padding: 10px 12px 14px; overflow: auto; }
  .griff { display: block; position: absolute; right: 12px; top: 10px; z-index: 1; }
  .griff .klein { padding: 6px 16px; font-size: 14px; background: var(--tanne); color: #fff; }
  .titelzeile { margin: 0 96px 10px 2px; min-height: 34px; gap: 10px; justify-content: flex-start; }
  .titelzeile .klein { padding: 5px 12px; font-size: 13px; }
  h2 { font-size: 24px; }
  .maerkte { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .kategorien { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .markt, .kat { min-height: 56px; }
  .kat { padding: 4px 8px 4px 4px; gap: 6px; }
  .kat img { width: 40px; height: 40px; }
  .kname { font-size: 14px; line-height: 1.15; }
  .zahl { min-width: 0; font-size: 12px; padding: 0 6px; }
  .detail { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 62%; z-index: 4; }
  .dkopf { height: 120px; }
  .dbild { max-height: 106px; }
  .zoom { display: none; }
  .quelle { top: calc(52px + env(safe-area-inset-top)); bottom: auto; left: 6px; right: auto; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
