/* Wichtelfenster – Handy-Seite (Weihnachtsgestaltung, W-017) */
@font-face { font-family: "Fraunces"; font-weight: 600; font-display: swap; src: url(../fonts/fraunces-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 700; font-display: swap; src: url(../fonts/fraunces-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Fraunces"; font-weight: 400; font-style: italic; font-display: swap; src: url(../fonts/fraunces-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 400; font-display: swap; src: url(../fonts/dm-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 500; font-display: swap; src: url(../fonts/dm-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 700; font-display: swap; src: url(../fonts/dm-sans-latin-700-normal.woff2) format("woff2"); }

/* Winternacht über Grimma: Tannengrün, Weihnachtsrot, Kerzengold auf warmem Schnee */
:root {
  --nacht: #0D1B2A;
  --nacht-2: #1A3550;
  --tanne: #14402F;
  --tanne-2: #1E5A42;
  --rot: #B5212E;
  --rot-dunkel: #85131E;
  --gold: #F2B93B;
  --gold-hell: #FFD978;
  --gold-dunkel: #B07D16;
  --schnee: #FBF6EC;
  --seite: #0D1924;
  --papier: #FFFBF3;
  --linie: #EADFC7;
  --text: #2A2019;
  --text-2: #6B5A49;
  --radius: 22px;
  --shadow: 0 14px 34px rgba(0, 0, 0, .35);
  --font-head: "Fraunces", Georgia, serif;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Altnamen, damit Verwaltung und ältere Teile weiter passen */
  --blau: var(--tanne-2);
  --blau-hell: #E7F1EB;
  --gruen: #2E7D5B;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font: 400 17px/1.5 var(--font); display: flex; flex-direction: column;
  background-color: var(--seite);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cg fill='none' stroke='%23FFFFFF' stroke-opacity='.06' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M30 18v20M20 28h20M23 21l14 14M37 21L23 35'/%3E%3Cpath d='M100 84v16M92 92h16M94.5 86.5l11 11M105.5 86.5l-11 11'/%3E%3C/g%3E%3Ccircle cx='110' cy='26' r='1.6' fill='%23F2B93B' fill-opacity='.25'/%3E%3Ccircle cx='22' cy='110' r='1.6' fill='%23F2B93B' fill-opacity='.25'/%3E%3C/svg%3E"), linear-gradient(180deg, #0E1B28 0%, #0B1620 100%);
  background-attachment: scroll, fixed;
}
img, svg { max-width: 100%; }
a { color: var(--rot); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 30px; } h2 { font-size: 24px; } h3 { font-size: 19px; }
p { margin: 0 0 .8em; }
.small { font-size: 14px; color: var(--text-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Kopf: Nachthimmel, Lichterkette, Schneefall, Grimma-Panorama ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff; text-align: center;
  background: linear-gradient(180deg, #050B14 0%, #0B1A2B 55%, #132A42 100%);
  padding: calc(22px + env(safe-area-inset-top)) 20px 0; min-height: 200px;
}
.hero--big { min-height: 420px; }
.hero__city { position: absolute; left: 50%; bottom: -1px; transform: translateX(-56%); width: max(960px, 100%); max-width: none; display: block; pointer-events: none; }
.hero:not(.hero--big) .hero__city { width: max(680px, 100%); bottom: -58px; transform: translateX(-59%); }
@media (min-width: 760px) { .hero__city, .hero:not(.hero--big) .hero__city { transform: translateX(-50%); width: max(1200px, 100%); } .hero:not(.hero--big) .hero__city { bottom: -70px; } }
.snowfall, .snowfall::after { position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background-image: radial-gradient(2px 2px at 20px 30px, #fff 50%, transparent 51%), radial-gradient(2.5px 2.5px at 90px 80px, #fff 50%, transparent 51%), radial-gradient(1.6px 1.6px at 150px 20px, #fff 50%, transparent 51%), radial-gradient(2px 2px at 60px 140px, #fff 50%, transparent 51%), radial-gradient(3px 3px at 170px 120px, rgba(255,255,255,.85) 50%, transparent 51%);
  background-size: 200px 180px; animation: snow 14s linear infinite; opacity: .8; }
.snowfall::after { content: ""; background-size: 260px 240px; animation-duration: 22s; opacity: .55; }
@keyframes snow { from { background-position: 0 0; } to { background-position: 40px 180px; } }
.brand { position: relative; z-index: 4; display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand__text { font-family: var(--font-head); font-weight: 700; font-size: 30px; letter-spacing: -.02em; text-shadow: 0 2px 14px rgba(0, 0, 0, .35); }
.brand__text span { color: var(--gold); }
.hero--big .brand__text { font-size: 42px; }
.hero__claim { position: relative; z-index: 4; margin: 6px 0 0; font-family: var(--font-head); font-style: italic; font-weight: 400; font-size: 19px; color: #E8EEF6; }
.hero__dates { position: relative; z-index: 4; display: inline-block; margin-top: 12px; padding: 7px 16px; border-radius: 999px; background: var(--rot); color: #fff; font-weight: 700; font-size: 15px; box-shadow: 0 4px 0 var(--rot-dunkel); }

/* ---------- Inhalt ---------- */
.app { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 18px 16px 40px; }
.card { background: var(--papier); border: 1px solid var(--linie); border-radius: var(--radius); padding: 22px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card--warn { border-color: #F0C9A8; background: #FFF5EA; }
.card--ribbon { position: relative; overflow: hidden; }
.card--ribbon::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: repeating-linear-gradient(90deg, var(--rot) 0 18px, var(--papier) 18px 24px, var(--tanne-2) 24px 42px, var(--papier) 42px 48px); }
.intro__title { font-size: 27px; color: var(--tanne); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.step { color: #fff; border-radius: 18px; padding: 14px 12px; }
.step:nth-child(1) { background: #8E1B25; } .step:nth-child(2) { background: #18493A; } .step:nth-child(3) { background: #1C3047; }
.step { border: 1px solid rgba(255, 255, 255, .08); }
.step h3 { color: #fff; font-size: 17px; margin: 6px 0 4px; }
.step p { font-size: 13.5px; line-height: 1.35; margin: 0; color: rgba(255, 255, 255, .86); }
.step__n { font-family: var(--font-head); font-size: 28px; font-weight: 700; color: var(--gold-hell); line-height: 1; }
@media (max-width: 400px) { .steps { grid-template-columns: 1fr; } .step { display: grid; grid-template-columns: 34px 1fr; column-gap: 8px; } .step__n { grid-row: span 2; } .step h3 { margin: 0; } }

/* ---------- Knöpfe & Eingaben ---------- */
.btn { appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 22px; border-radius: 999px; font: 700 17px/1.2 var(--font); text-decoration: none; transition: transform .12s ease, box-shadow .12s ease, background .2s; }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .choice:focus-visible, .medal:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.btn--gold { background: var(--rot); color: #fff; box-shadow: 0 6px 0 var(--rot-dunkel); }
.btn--gold:active { box-shadow: 0 2px 0 var(--rot-dunkel); transform: translateY(4px); }
.btn--blue { background: var(--tanne-2); color: #fff; }
.btn--ghost { background: transparent; color: var(--tanne-2); border: 2px solid currentColor; }
.btn--wide { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
input.text, .code-input { width: 100%; min-height: 54px; padding: 12px 16px; border: 2px solid var(--linie); border-radius: 16px; background: #fff; font: 500 19px/1.2 var(--font); color: var(--text); }
.code-input { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .12em; text-transform: uppercase; text-align: center; font-weight: 700; }
input:focus { outline: none; border-color: var(--tanne-2); box-shadow: 0 0 0 4px rgba(30, 90, 66, .15); }
.restore { display: grid; gap: 10px; margin-top: 10px; }
.restore__row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.restore label { font-weight: 500; font-size: 15px; color: var(--text-2); }
.form-msg { min-height: 1.2em; margin: 8px 0 0; font-weight: 500; color: var(--rot); }
.form-msg.ok { color: var(--tanne-2); }

/* ---------- Laden-Karte ---------- */
.shop { padding: 0; overflow: hidden; }
.shop__photo { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; display: block; background: #EDE4D0; }
.shop__placeholder { aspect-ratio: 16 / 7; display: grid; place-items: center; background: linear-gradient(180deg, #EAF2EC, var(--schnee)); }
.shop__placeholder img { height: 80%; }
.shop__body { padding: 18px 20px 20px; }
.shop__hello { margin: 0 0 2px; font-size: 15px; color: var(--text-2); }
.shop__name { margin: 0 0 4px; font-size: 27px; color: var(--tanne); }
.shop__greet { margin: 0 0 10px; font-family: var(--font-head); font-style: italic; font-weight: 400; color: var(--text-2); }
.shop__link { font-weight: 700; text-decoration: none; }
.shop__link::after { content: " ↗"; }

/* ---------- Wichtelfrage ---------- */
.ask__eyebrow { margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--rot); }
.ask__title { font-size: 25px; color: var(--tanne); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.choice { appearance: none; cursor: pointer; border: 3px solid var(--linie); background: #fff; border-radius: 20px; padding: 10px 8px 12px; display: grid; justify-items: center; gap: 4px; font: 700 15px/1.25 var(--font); color: var(--text); text-align: center; transition: transform .15s ease, border-color .15s; }
.choice img { width: 100%; max-width: 130px; aspect-ratio: 3 / 4; }
.choice small { display: block; font-weight: 500; color: var(--text-2); }
.choice:active { transform: scale(.96); }
.choice.is-picked { border-color: var(--tanne-2); }
.choice.is-wrong { border-color: var(--rot); animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.lock { text-align: center; }
.lock__time { font-family: var(--font-head); font-weight: 700; font-size: 44px; color: var(--rot); margin: 6px 0 10px; font-variant-numeric: tabular-nums; }

/* ---------- Gefunden & Bewertung ---------- */
.found { text-align: center; position: relative; overflow: hidden; }
.stamp { width: 120px; height: 120px; margin: 4px auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--tanne-2); color: #fff; box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .22), 0 0 0 6px var(--gold), 0 10px 22px rgba(20, 64, 47, .35); animation: stamp .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.stamp svg { width: 64px; height: 64px; }
@keyframes stamp { from { transform: scale(2.2) rotate(-18deg); opacity: 0; } to { transform: scale(1) rotate(-6deg); opacity: 1; } }
.medals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.medal { appearance: none; cursor: pointer; border: 3px solid var(--linie); background: #fff; border-radius: 20px; padding: 12px 6px; display: grid; justify-items: center; gap: 6px; font: 700 16px var(--font); color: var(--text); }
.medal svg { width: 62px; height: 72px; }
.medal.is-picked { border-color: var(--gold-dunkel); background: #FFF6DE; }
.counter { display: inline-flex; align-items: baseline; gap: 8px; margin: 6px 0 10px; }
.counter b { font-family: var(--font-head); font-size: 52px; line-height: 1; color: var(--rot); }
.rankhint { display: inline-block; margin: 0 0 12px; padding: 6px 14px; border-radius: 999px; background: #FFF3D6; color: var(--gold-dunkel); font-weight: 700; font-size: 15px; }

/* ---------- Wichtelpass ---------- */
.pass { background: linear-gradient(160deg, var(--tanne-2), var(--tanne) 70%); color: #fff; border: 0; position: relative; overflow: hidden; }
.pass::after { content: ""; position: absolute; right: -50px; top: -50px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(242, 185, 59, .28), transparent 70%); }
.pass::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: repeating-linear-gradient(90deg, var(--rot) 0 16px, var(--gold) 16px 22px); }
.pass__label { margin: 0; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-hell); font-weight: 700; }
.pass__nick { font-family: var(--font-head); font-size: 26px; font-weight: 700; margin: 2px 0 12px; color: #fff; }
.pass__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; position: relative; z-index: 1; }
.pass__code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 700; font-size: 30px; letter-spacing: .12em; color: var(--gold-hell); }
.pass__found { font-size: 15px; color: #D7E8DE; }
.pass__hint { font-size: 14px; color: #D7E8DE; margin: 10px 0 0; position: relative; z-index: 1; }
.pass__qr { background: #fff; border-radius: 14px; padding: 8px; width: 132px; height: 132px; }
.pass__qr svg { display: block; width: 100%; height: 100%; }
.pass__win { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--gold); color: var(--text); font-weight: 700; position: relative; z-index: 1; }
.newcode { text-align: center; }
.newcode .pass__code { display: block; font-size: 40px; margin: 8px 0; color: var(--rot); }

/* ---------- Rangliste ---------- */
.rank h2 { color: var(--tanne); }
.rank__sub { color: var(--text-2); font-size: 15px; }
.rank__list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; counter-reset: none; }
.rank__row { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--linie); }
.rank__pos { font-family: var(--font-head); font-weight: 700; font-size: 20px; color: var(--text-2); text-align: center; }
.rank__row:nth-child(1) .rank__pos { color: var(--gold-dunkel); } .rank__row:nth-child(2) .rank__pos { color: #8A96A3; } .rank__row:nth-child(3) .rank__pos { color: #A9653A; }
.rank__row:nth-child(-n+3) { background: #FFFBF0; }
.rank__name { font-weight: 700; }
.rank__me { background: #FDECEC !important; border-color: #EDB7B9; }
.rank__tag { font-size: 13px; font-weight: 700; color: var(--rot); }
.rank__mine { margin: 10px 0 0; font-weight: 700; color: var(--rot); }
.rank__done { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--tanne); color: #fff; font-weight: 500; }
.rank__done b { color: var(--gold-hell); font-family: var(--font-head); font-size: 22px; }

/* ---------- Finale ---------- */
.finale { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: radial-gradient(120% 80% at 50% 10%, #24496E, var(--nacht) 70%); color: #fff; overflow-y: auto; }
.finale canvas { z-index: 0; position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.finale__box { position: relative; z-index: 2; width: 100%; max-width: 440px; text-align: center; }
.finale__santa { width: 210px; margin: 0 auto -6px; display: block; animation: santa 1.1s cubic-bezier(.2, 1.4, .4, 1) .3s both; transform-origin: 50% 100%; }
@keyframes santa { from { transform: translateY(80px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.finale h1 { font-size: 32px; color: #fff; margin-top: 8px; }
.finale h1 span { color: var(--gold); }
.finale p { color: #E3EAF2; }
.finale .card { text-align: left; }
.finale .card:not(.pass) { color: var(--text); }
.finale__close { margin-top: 6px; }
.bells { font-size: 34px; letter-spacing: 6px; animation: ring .6s ease-in-out infinite alternate; display: inline-block; }
@keyframes ring { from { transform: rotate(-10deg); } to { transform: rotate(10deg); } }

/* ---------- Ladeanzeige ---------- */
.loading { display: flex; gap: 8px; justify-content: center; padding: 60px 0; }
.loading span { width: 12px; height: 12px; border-radius: 50%; background: var(--rot); animation: bounce 1s infinite ease-in-out; }
.loading span:nth-child(2) { animation-delay: .15s; background: var(--gold); } .loading span:nth-child(3) { animation-delay: .3s; background: var(--tanne-2); }
@keyframes bounce { 50% { transform: translateY(-14px); opacity: .5; } }
.fade-in { animation: fadein .35s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Fuß ---------- */
.foot { background: #07120E; color: #CFE2D7; padding: 28px 16px calc(28px + env(safe-area-inset-bottom)); border-top: 6px solid var(--rot); }
.foot__in { max-width: 560px; margin: 0 auto; display: grid; justify-items: center; gap: 12px; text-align: center; }
.foot__logos { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.foot__logos a, .foot__logos span { display: inline-flex; background: #fff; border-radius: 12px; padding: 6px; }
.foot__logo { height: 56px; width: auto; display: block; }
.foot__note { margin: 0; font-size: 14px; }
.foot__nav { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; }
.foot__nav a { color: #F3F7F4; font-size: 14px; }

/* ---------- Rechtstexte ---------- */
.legal h1 { font-size: 28px; color: var(--tanne); }
.legal h2 { font-size: 19px; margin-top: 1.2em; }
.legal-list li { margin-bottom: .6em; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
