/* Design A: Weihnachtsmarkt bei Nacht */
[hidden] { display: none !important; }
:root {
  --night: #0c1d18; --fir: #14302a; --fir-2: #1d4436; --fir-3: #275a47;
  --gold: #e8b85e; --candle: #f7dca0; --mulled: #c23a44; --berry: #e0636b;
  --snow: #eef3ef; --muted: #a8bfb4; --line: rgba(232, 184, 94, .28);
  --mint: #8fd6a8; --ice: #9fd8e6;
  --paper: #f6f0e1; --ink: #1a2a24;
  --f-display: "UnifrakturMaguntia", "Old English Text MT", Georgia, serif;
  --f-head: "Alegreya SC", Georgia, serif;
  --f-body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; min-height: 100dvh;
  background: var(--night);
  background-image: radial-gradient(900px 500px at 85% -10%, rgba(232,184,94,.14), transparent 60%),
                    radial-gradient(800px 500px at 0% 40%, rgba(39,90,71,.5), transparent 70%);
  background-attachment: fixed;
  color: var(--snow); font-family: var(--f-body); font-size: 17px; line-height: 1.5;
  padding: env(safe-area-inset-top) max(14px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(14px, env(safe-area-inset-left));
}
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.wrap { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; padding-bottom: 40px; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.loading { text-align: center; color: var(--muted); padding-top: 30vh; }

.lights { position: relative; z-index: 1; height: 26px; max-width: 720px; margin: 0 auto; display: flex; justify-content: space-between; padding: 0 6px; }
.lights::before { content: ""; position: absolute; left: 0; right: 0; top: 2px; height: 12px; border-bottom: 2px solid rgba(168,191,180,.35); border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.lights i { width: 9px; height: 13px; border-radius: 50% 50% 45% 45%; margin-top: 11px; animation: tw 2.4s infinite ease-in-out; }
.lights i:nth-child(4n+1) { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.lights i:nth-child(4n+2) { background: var(--berry); box-shadow: 0 0 10px var(--berry); animation-delay: .6s; }
.lights i:nth-child(4n+3) { background: var(--mint); box-shadow: 0 0 10px var(--mint); animation-delay: 1.2s; }
.lights i:nth-child(4n) { background: var(--ice); box-shadow: 0 0 10px var(--ice); animation-delay: 1.8s; }
@keyframes tw { 50% { opacity: .4; } }

h1 { font-family: var(--f-display); font-weight: 400; color: var(--candle); text-shadow: 0 0 24px rgba(232,184,94,.4); font-size: clamp(2.4rem, 11vw, 3.8rem); line-height: 1; margin: 14px 0 6px; text-align: center; }
.subtitle { text-align: center; color: var(--muted); margin: 0 0 16px; }
.btn { background: var(--gold); color: #1a1a10; border: 0; border-radius: 999px; padding: 11px 22px; font-weight: 700; cursor: pointer; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--gold); border: 1px solid var(--line); }
.err { color: var(--berry); min-height: 1.4em; }
input[type=text], input[type=password] { font: inherit; font-size: 18px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(12,29,24,.8); color: var(--snow); width: 100%; }

/* Login + Profile */
.card { background: linear-gradient(180deg, rgba(29,68,54,.85), rgba(20,48,42,.85)); border: 1px solid rgba(168,191,180,.2); border-radius: 18px; padding: 20px; }
.login { max-width: 380px; margin: 12vh auto 0; display: grid; gap: 12px; text-align: center; }
.people { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 18px; }
.person { display: grid; place-items: center; gap: 4px; padding: 22px 10px; border-radius: 18px; border: 2px solid var(--gold); background: linear-gradient(160deg, var(--fir-3), var(--fir)); color: var(--candle); cursor: pointer; }
.person .av { font-size: 44px; line-height: 1; }
.person .nm { font-family: var(--f-head); font-size: 1.3rem; }

/* Header bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 12px; flex-wrap: wrap; }
.who { display: flex; align-items: center; gap: 8px; background: rgba(20,48,42,.8); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 6px; color: var(--snow); cursor: pointer; }
.who .av { font-size: 22px; }
.score { text-align: right; font-variant-numeric: tabular-nums; }
.score .fam { font-family: var(--f-head); color: var(--candle); font-size: 1.15rem; }
.score .me { color: var(--muted); font-size: .9rem; }
.admin-banner { background: var(--mulled); color: #fff; border-radius: 10px; padding: 6px 12px; text-align: center; margin-bottom: 10px; font-size: .9rem; }

/* Kalender */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; perspective: 900px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(6, 1fr); } }
.door { position: relative; aspect-ratio: 1 / 1.1; border-radius: 10px; border: 0; padding: 0; background: var(--paper); cursor: pointer; }
.door .panel { position: absolute; inset: 0; border-radius: 10px; display: grid; place-items: center; transform-origin: left center; transition: transform .7s cubic-bezier(.3,1.3,.5,1);
  background: repeating-linear-gradient(90deg, rgba(0,0,0,.12) 0 1px, transparent 1px 9px), linear-gradient(160deg, var(--fir-3), var(--fir));
  border: 2px solid var(--gold); box-shadow: inset 0 0 0 4px rgba(12,29,24,.45); }
.door .num { font-family: var(--f-display); font-size: clamp(1.6rem, 7vw, 2.3rem); color: var(--candle); text-shadow: 0 0 10px rgba(232,184,94,.5); }
.door .knob { position: absolute; right: 8px; top: 50%; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.door .inside { position: absolute; inset: 0; display: grid; place-items: center; color: var(--mulled); font-size: .8rem; font-weight: 700; text-align: center; line-height: 1.1; }
.door .inside b { display: block; font-family: var(--f-display); font-size: 1.4rem; font-weight: 400; }
.door.opened .panel { transform: rotateY(-78deg); }
.door.available .panel { box-shadow: inset 0 0 0 4px rgba(12,29,24,.45), 0 0 0 2px var(--gold); }
.door.today .panel { box-shadow: inset 0 0 0 4px rgba(12,29,24,.45), 0 0 0 2px var(--mulled), 0 0 18px rgba(232,184,94,.6); animation: pulse 2.2s infinite ease-in-out; }
@keyframes pulse { 50% { box-shadow: inset 0 0 0 4px rgba(12,29,24,.45), 0 0 0 2px var(--mulled), 0 0 4px rgba(232,184,94,.2); } }
.door.locked .panel { filter: saturate(.6) brightness(.8); }
.door.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.door.preview .panel { outline: 2px dashed var(--mulled); }
.hint { text-align: center; color: var(--muted); font-size: .92rem; margin-top: 14px; min-height: 1.4em; }
.links { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 10; background: rgba(5,12,10,.72); display: grid; place-items: end center; padding: 0; }
@media (min-width: 640px) { .modal { place-items: center; padding: 20px; } }
.sheet { position: relative; width: 100%; max-width: 640px; max-height: 92dvh; overflow: auto; background: var(--paper); color: var(--ink); border-radius: 22px 22px 0 0; padding: 22px 18px calc(24px + env(safe-area-inset-bottom)); border-top: 4px solid var(--gold); animation: up .35s ease-out; }
@media (min-width: 640px) { .sheet { border-radius: 22px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.close { position: absolute; right: 12px; top: 8px; border: 0; background: none; font-size: 30px; color: #5b6e66; cursor: pointer; line-height: 1; }
.sheet .daynum { font-family: var(--f-display); font-size: 3rem; color: var(--mulled); line-height: 1; }
.sheet h2 { font-family: var(--f-head); margin: 0 0 4px; color: var(--fir); font-size: 1.5rem; }
.sheet .occ { font-family: var(--f-head); color: var(--mulled); letter-spacing: .05em; font-size: .9rem; }
.sheet .chip { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--fir); color: var(--candle); margin-bottom: 6px; }
.sheet p { margin: 8px 0; }
.sheet .joke { border-left: 3px solid var(--gold); padding: 4px 0 4px 10px; margin: 12px 0; }
.sheet .joke span { color: #4b5d55; }
.sheet .box { background: #fff; border: 1px solid #e1d6bd; border-radius: 14px; padding: 12px 14px; margin: 12px 0; }
.sheet .reveal { background: #eaf4ee; border-color: #b9d8c4; }
.sheet .reveal b { color: #1f6b44; }
.sheet .priv { background: #fff4e0; border: 2px dashed var(--mulled); border-radius: 16px; padding: 18px; text-align: center; font-size: 1.25rem; font-family: var(--f-head); color: #5a2e18; }
.sheet .q { margin: 14px 0; }
.sheet .q > b { display: block; margin-bottom: 6px; }
.opts { display: grid; gap: 6px; }
.opt { text-align: left; border: 2px solid #d7ccb4; background: #fff; color: var(--ink); border-radius: 12px; padding: 9px 12px; cursor: pointer; }
.opt[aria-pressed=true] { border-color: var(--fir-3); background: #e3efe8; }
.opt.right { border-color: #2f8a57; background: #dff3e6; }
.opt.wrong { border-color: var(--mulled); background: #fbe3e4; }
.sheet input[type=text] { background: #fff; color: var(--ink); border-color: #d7ccb4; }
.sheet .btn { margin-top: 10px; }
.result { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--fir); color: var(--candle); font-family: var(--f-head); font-size: 1.1rem; text-align: center; }
.result small { display: block; font-family: var(--f-body); color: var(--muted); font-size: .85rem; }
.ok-mark { color: #2f8a57; font-weight: 700; } .no-mark { color: var(--mulled); font-weight: 700; }
.solutions { margin-top: 12px; }
.preview-box { margin-top: 14px; background: #fff0f0; border: 1px dashed var(--mulled); border-radius: 12px; padding: 10px 12px; font-size: .9rem; }
.preview-box pre { white-space: pre-wrap; word-break: break-word; font-size: .78rem; }

/* Scoreboard */
.board { display: grid; gap: 8px; margin-top: 10px; }
.row { display: grid; grid-template-columns: 2rem 1fr auto; gap: 8px; align-items: center; background: #fff; border-radius: 12px; padding: 8px 12px; border: 1px solid #e1d6bd; }
.row .av { font-size: 1.4rem; }
.row .pts { font-variant-numeric: tabular-nums; font-weight: 700; }
.row small { color: #6b7d75; }
.fam-total { text-align: center; font-family: var(--f-display); font-size: 2.6rem; color: var(--mulled); line-height: 1.1; }

/* Spiele */
.mem { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.mem button { aspect-ratio: 1; border-radius: 12px; border: 2px solid var(--gold); background: linear-gradient(160deg, var(--fir-3), var(--fir)); font-size: clamp(1.4rem, 7vw, 2.2rem); cursor: pointer; color: transparent; transition: transform .25s; }
.mem button.up, .mem button.done { background: #fff; color: inherit; transform: rotateY(180deg) scaleX(-1); }
.mem button.done { border-color: #2f8a57; opacity: .7; }
.ws { display: grid; gap: 2px; margin: 12px 0; user-select: none; touch-action: manipulation; }
.ws button { aspect-ratio: 1; border: 0; border-radius: 4px; background: #fff; color: var(--ink); font-weight: 700; font-size: clamp(.7rem, 3.4vw, 1rem); padding: 0; cursor: pointer; }
.ws button.sel { background: var(--gold); }
.ws button.found { background: #bfe3cc; }
.words { display: flex; flex-wrap: wrap; gap: 6px; }
.words span { font-size: .85rem; padding: 2px 8px; border-radius: 999px; background: #efe6d1; }
.words span.found { background: #bfe3cc; text-decoration: line-through; }
.klick { position: relative; height: 340px; border-radius: 16px; overflow: hidden; background: linear-gradient(180deg, #0f2620, #1d4436); margin: 12px 0; touch-action: manipulation; }
.klick .ball { position: absolute; width: 46px; height: 46px; border-radius: 50%; border: 0; background: radial-gradient(circle at 35% 30%, #fff, #dfe9ef 60%, #b9cbd6); box-shadow: 0 2px 8px rgba(0,0,0,.4); cursor: pointer; }
.klick .hud { position: absolute; left: 10px; right: 10px; top: 8px; display: flex; justify-content: space-between; color: var(--candle); font-family: var(--f-head); font-size: 1.2rem; pointer-events: none; }
.klick .start { position: absolute; inset: 0; display: grid; place-items: center; }
.wordle { display: grid; gap: 6px; margin: 12px auto; max-width: 300px; }
.wordle .r { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.wordle .c { aspect-ratio: 1; display: grid; place-items: center; border: 2px solid #d7ccb4; border-radius: 8px; font-weight: 700; font-size: 1.4rem; background: #fff; }
.wordle .c.s2 { background: #2f8a57; border-color: #2f8a57; color: #fff; }
.wordle .c.s1 { background: var(--gold); border-color: var(--gold); }
.wordle .c.s0 { background: #8a948f; border-color: #8a948f; color: #fff; }
.wordle-in { display: flex; gap: 8px; max-width: 300px; margin: 0 auto; }
.wordle-in input { text-transform: uppercase; letter-spacing: .3em; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .lights i, .door.today .panel { animation: none; }
  .door .panel { transition: none; }
}
