/* BT Adventskalender – Frontend. Leitfarbe: Honeyed Amber #E8833F */
.btak { --btak-ink: #2b2b2b; --btak-paper: #fffaf3; position: relative; color: var(--btak-ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, Verdana, sans-serif; margin: 1.5rem 0; }
.btak *, .btak *::before, .btak *::after { box-sizing: border-box; }

.btak__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.btak__title { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: clamp(1.4rem, 3.5vw, 2.1rem); line-height: 1.15; }
.btak__mute { border: 1px solid rgba(0,0,0,.15); background: #fff; border-radius: 999px; width: 2.5rem; height: 2.5rem; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.btak__mute:focus-visible { outline: 3px solid var(--btak-active); outline-offset: 2px; }
.btak__mute .btak__mute-off { display: none; }
.btak__mute[aria-pressed="true"] .btak__mute-on { display: none; }
.btak__mute[aria-pressed="true"] .btak__mute-off { display: inline; }

/* Bühne */
.btak__stage { position: relative; container-type: inline-size; }
.btak--grid .btak__stage { display: grid; grid-template-columns: repeat(var(--btak-cols), minmax(0, 1fr)); gap: clamp(.4rem, 1.2vw, 1rem); }
.btak--free .btak__stage { background: #f3e7d6 center / cover no-repeat; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 30px rgba(51,51,51,.15); }

/* Türchen */
.btak__door { position: relative; display: block; padding: 0; margin: 0; border: 0; background: none; cursor: pointer; perspective: 800px; -webkit-tap-highlight-color: transparent; font: inherit; }
.btak--grid .btak__door { aspect-ratio: 1 / 1.08; }
.btak--free .btak__door { position: absolute; }
.btak__door:focus-visible { outline: 3px solid #fff; box-shadow: 0 0 0 6px var(--btak-active); border-radius: 12px; z-index: 3; }

.btak__inside { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: radial-gradient(circle at 50% 55%, #fff6dc 0%, #ffd58f 55%, #f2a65a 100%); box-shadow: inset 0 3px 10px rgba(0,0,0,.28); }
.btak__inside-n { font-family: Georgia, serif; font-weight: 700; font-size: clamp(1rem, 5cqw, 2.4rem); color: rgba(51,51,51,.28); }

.btak__leaf { --c: var(--btak-future); --t: var(--btak-future-t); position: absolute; inset: 0; border-radius: 12px; background-color: var(--c); background-size: cover; background-position: center; color: var(--t); display: flex; align-items: center; justify-content: center; transform-origin: left center; transition: transform .85s cubic-bezier(.3,.7,.2,1), opacity .5s ease, filter .3s ease; backface-visibility: hidden; box-shadow: 0 4px 12px rgba(0,0,0,.22), inset 0 0 0 2px rgba(255,255,255,.22); overflow: hidden; }
.btak__leaf::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,0) 45%, rgba(0,0,0,.12)); pointer-events: none; }
.btak__door[data-state="active"] .btak__leaf { --c: var(--btak-active); --t: var(--btak-active-t); }
.btak__door[data-state="past"] .btak__leaf { --c: var(--btak-past); --t: var(--btak-past-t); }
.btak__num { position: relative; font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: clamp(1.1rem, 6.2cqw, 3rem); line-height: 1; text-shadow: 0 1px 3px rgba(0,0,0,.25); }
.btak__door .btak__leaf[style*="background-image"] .btak__num { background: rgba(0,0,0,.45); color: #fff; padding: .15em .45em; border-radius: 999px; }

.btak__lock, .btak__seen { position: absolute; top: 6%; right: 8%; font-size: clamp(.7rem, 2.6cqw, 1.2rem); line-height: 1; opacity: 0; transition: opacity .2s ease; }
.btak__door[data-locked="1"]:hover .btak__lock, .btak__door[data-locked="1"]:focus-visible .btak__lock { opacity: 1; }
.btak__seen { font-weight: 700; background: #fff; color: #2b2b2b; border-radius: 999px; width: 1.5em; height: 1.5em; display: none; align-items: center; justify-content: center; font-size: clamp(.6rem, 2.2cqw, 1rem); }
.btak__door.is-seen .btak__seen { display: flex; opacity: 1; }

.btak__door[data-locked="1"] .btak__leaf { filter: saturate(.85); }
.btak__door[data-locked="1"]:hover .btak__leaf { transform: rotateY(-8deg); }
.btak__door[data-locked="0"]:hover .btak__leaf { transform: rotateY(-22deg); }
.btak__door[data-state="active"]:not(.is-open) .btak__leaf { animation: btak-glow 2.4s ease-in-out infinite; }
@keyframes btak-glow { 0%,100% { box-shadow: 0 4px 12px rgba(0,0,0,.22), 0 0 0 0 rgba(232,131,63,.55); } 50% { box-shadow: 0 4px 12px rgba(0,0,0,.22), 0 0 0 10px rgba(232,131,63,0); } }

/* offen */
.btak__door.is-open .btak__leaf { transform: rotateY(-118deg); animation: none; }
.btak[data-door3d="0"] .btak__door.is-open .btak__leaf { transform: none; opacity: 0; pointer-events: none; }
.btak[data-door3d="0"] .btak__door.is-seen .btak__leaf { opacity: .0; }
.btak__door.is-seen:not(.is-open) .btak__leaf { transform: rotateY(-118deg); }
.btak[data-door3d="0"] .btak__door.is-seen:not(.is-open) .btak__leaf { transform: none; opacity: 0; }
.btak__door.is-seen .btak__seen { display: none; }
.btak__door.is-seen .btak__inside-n { color: rgba(51,51,51,.5); }

.btak__door.is-shake .btak__leaf { animation: btak-shake .45s ease; }
@keyframes btak-shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* Hinweis bei verschlossen */
.btak__toast { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 5; background: #2b2b2b; color: #fff; padding: .6rem 1rem; border-radius: 10px; font-size: .9rem; max-width: min(90%, 28rem); text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.3); }

/* Dialog */
.btak__modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.btak__modal[hidden] { display: none; }
.btak__backdrop { position: absolute; inset: 0; background: rgba(43,43,43,.62); backdrop-filter: blur(2px); animation: btak-fade .25s ease; }
.btak__dialog { position: relative; width: min(100%, 36rem); max-height: 90vh; overflow: auto; background: var(--btak-paper); border-radius: 18px; border-top: 8px solid var(--btak-active); box-shadow: 0 24px 60px rgba(0,0,0,.4); padding: 1.6rem 1.4rem 1.4rem; animation: btak-pop .4s cubic-bezier(.2,1.2,.3,1); }
.btak__dialog:focus { outline: none; }
@keyframes btak-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes btak-pop { from { opacity: 0; transform: translateY(14px) scale(.94); } to { opacity: 1; transform: none; } }
.btak__close { position: absolute; top: .5rem; right: .6rem; width: 2.4rem; height: 2.4rem; border: 0; border-radius: 50%; background: rgba(0,0,0,.07); color: var(--btak-ink); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.btak__close:hover { background: rgba(0,0,0,.14); }
.btak__close:focus-visible, .btak__btn:focus-visible, .btak__share a:focus-visible, .btak__share button:focus-visible { outline: 3px solid var(--btak-ink); outline-offset: 2px; }

.btak__badge { display: inline-block; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; background: var(--btak-active); color: var(--btak-active-t); padding: .25rem .65rem; border-radius: 999px; margin-bottom: .6rem; }
.btak__mtitle { margin: 0 2rem .7rem 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.35rem, 4vw, 1.8rem); line-height: 1.2; }
.btak__content { line-height: 1.6; }
.btak__content p { margin: 0 0 .8em; }
.btak__content img, .btak__image { max-width: 100%; height: auto; border-radius: 12px; display: block; margin: 0 0 1rem; }
.btak__video { margin: 0 0 1rem; }
.btak__video iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 12px; }

.btak__btn { display: inline-block; border: 0; cursor: pointer; text-decoration: none; font: inherit; font-weight: 700; background: var(--btak-active); color: var(--btak-active-t); padding: .75rem 1.3rem; border-radius: 999px; box-shadow: 0 3px 0 rgba(0,0,0,.18); transition: transform .15s ease, box-shadow .15s ease; }
.btak__btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 rgba(0,0,0,.18); }
.btak__code { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 1rem 0; padding: .8rem 1rem; border: 2px dashed var(--btak-active); border-radius: 12px; background: #fff; }
.btak__code code { font-size: 1.25rem; font-weight: 700; letter-spacing: .08em; background: none; padding: 0; color: var(--btak-ink); }

.btak__form { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid rgba(0,0,0,.1); display: grid; gap: .65rem; }
.btak__form h3 { margin: 0; font-size: 1.05rem; }
.btak__form label { display: grid; gap: .25rem; font-size: .9rem; }
.btak__form input[type="text"], .btak__form input[type="email"] { width: 100%; padding: .65rem .8rem; border: 1px solid rgba(0,0,0,.28); border-radius: 10px; font: inherit; background: #fff; color: var(--btak-ink); }
.btak__form input:focus-visible { outline: 3px solid var(--btak-active); outline-offset: 1px; }
.btak__form .btak__consent { display: flex; align-items: flex-start; gap: .55rem; font-size: .8rem; line-height: 1.4; }
.btak__form .btak__consent input { margin-top: .2rem; }
.btak__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.btak__msg { font-size: .9rem; padding: .55rem .8rem; border-radius: 10px; background: #eef6ee; }
.btak__msg.is-error { background: #fbeaea; }

.btak__share { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid rgba(0,0,0,.1); font-size: .85rem; }
.btak__share a, .btak__share button { border: 1px solid rgba(0,0,0,.2); background: #fff; color: var(--btak-ink); padding: .4rem .8rem; border-radius: 999px; text-decoration: none; cursor: pointer; font: inherit; font-size: .85rem; }
.btak__share a:hover, .btak__share button:hover { border-color: var(--btak-active); }

.btak__fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 100000; }

@media (max-width: 640px) {
	.btak--grid .btak__stage { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.btak__dialog { padding: 1.3rem 1.1rem 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
	.btak__leaf, .btak__dialog, .btak__backdrop { transition: none !important; animation: none !important; }
	.btak__door[data-state="active"]:not(.is-open) .btak__leaf { animation: none; }
}

/* ===== Weihnachtsszene ===== */
.btak--festive .btak__stage { background-color: #0d1a38; border-radius: 18px; overflow: hidden; box-shadow: 0 10px 34px rgba(13,26,56,.35); }
.btak--festive.btak--grid .btak__stage { padding: 3% 7% 27%; column-gap: 2.2%; row-gap: clamp(.5rem, 1.7vw, 1.3rem); }
.btak--festive.btak--grid .btak__door { aspect-ratio: 1 / .84; }
.btak--festive .btak__door { filter: drop-shadow(0 4px 7px rgba(0,0,0,.4)); }

.btak__scene { position: absolute; left: 0; right: 0; bottom: 0; z-index: 0; pointer-events: none; }
.btak__scene svg { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; }
.btak--festive .btak__stage::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background-image: radial-gradient(circle, #fff 0 1px, transparent 1.6px), radial-gradient(circle, rgba(255,255,255,.8) 0 1px, transparent 1.6px), radial-gradient(circle, #fff 0 1.4px, transparent 2px); background-size: 130px 110px, 90px 150px, 210px 170px; background-position: 12px 20px, 55px 70px, 100px 40px; }
.btak__plane { position: absolute; z-index: 3; top: 33%; left: 100%; width: 44%; pointer-events: none; opacity: .96; animation: btak-plane 66s linear infinite; animation-delay: -22s; }
.btak__plane svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); }
@keyframes btak-plane { from { transform: translateX(0); } to { transform: translateX(-340%); } }
.btak-bal-in { animation: btak-balbob 7s ease-in-out infinite; }
@keyframes btak-balbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

.btak__logo { position: absolute; z-index: 3; bottom: 2.4%; display: flex; align-items: center; padding: .4rem .85rem; background: rgba(255,255,255,.94); border-radius: 999px; box-shadow: 0 3px 12px rgba(0,0,0,.28); max-width: 36%; pointer-events: none; }
.btak__logo img { display: block; width: auto; height: auto; max-width: 100%; height: clamp(26px, 5vw, 58px); }
.btak__logo--l { left: 3%; }
.btak__logo--r { right: 3%; }
.btak__logo--c { left: 50%; transform: translateX(-50%); }
.btak-star { animation: btak-twinkle 3.6s ease-in-out infinite; }
.btak-tw { animation: btak-twinkle 1.3s ease-in-out infinite; }
@keyframes btak-twinkle { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

.btak__snow { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.btak__snow i { position: absolute; top: -3%; border-radius: 50%; background: #fff; opacity: .85; box-shadow: 0 0 4px rgba(255,255,255,.7); animation: btak-fall linear infinite; }
@keyframes btak-fall { from { top: -3%; transform: translateX(0); } to { top: 102%; transform: translateX(var(--d, 20px)); } }

.btak__sleigh { position: absolute; z-index: 4; top: 2%; left: 0; width: 38%; pointer-events: none; animation: btak-fly 30s linear infinite; }
.btak__sleigh svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 8px 10px rgba(0,0,0,.35)); animation: btak-bob 2.4s ease-in-out infinite; }
@keyframes btak-fly {
	0%   { transform: translate(-115%, 0); }
	35%  { transform: translate(75%, 190%); }
	70%  { transform: translate(270%, 20%); }
	100% { transform: translate(270%, 20%); }
}
@keyframes btak-bob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-5%) rotate(1.5deg); } }

.btak--festive .btak__leaf { padding-top: 7%; }
.btak--festive .btak__leaf::after { content: ""; position: absolute; left: -2%; right: -2%; top: -1px; height: 23%; background: #fff; border-radius: 12px 12px 55% 45% / 12px 12px 100% 90%; box-shadow: 0 2px 4px rgba(0,0,0,.2); pointer-events: none; }
.btak--festive .btak__door .btak__leaf[style*="background-image"]::after { height: 16%; }

@media (max-width: 640px) {
	.btak--festive.btak--grid .btak__stage { padding: 17% 5% 34%; column-gap: 3%; row-gap: .7rem; }
	.btak--festive.btak--grid .btak__door { aspect-ratio: 1 / .9; }
	.btak__sleigh { width: 62%; }
	.btak__logo { top: 1.6%; bottom: auto; max-width: 52%; padding: .3rem .65rem; }
	.btak__logo img { height: 32px; }
	.btak__plane { width: 60%; }
}

@media (prefers-reduced-motion: reduce) {
	.btak__sleigh { animation: none; transform: none; left: 5%; top: 3%; }
	.btak__sleigh svg, .btak-star, .btak-tw { animation: none; }
	.btak__snow { display: none; }
	.btak__plane { display: none; }
	.btak-bal-in { animation: none; }
}

/* 1.3.0: Motiv als Vorschaubild in geöffneten Türchen, KI-Hinweis */
.btak__inside.has-thumb { background-size: cover; background-position: center; background-repeat: no-repeat; }
.btak__inside.has-thumb .btak__inside-n { position: absolute; left: 6%; bottom: 6%; font-size: clamp(.7rem, 3.2cqw, 1.1rem); color: #fff; background: rgba(0,0,0,.5); padding: .1em .5em; border-radius: 999px; line-height: 1.4; }
.btak__door.is-seen .btak__inside.has-thumb .btak__inside-n { color: #fff; }
.btak__note { margin: .6rem 0 0; text-align: center; font-size: .8rem; color: #7a7a7a; }

/* 1.3.0: Countdown bis zum Start */
.btak--countdown .btak__stage { display: flex; justify-content: center; align-items: flex-start; min-height: clamp(460px, 62vw, 680px); padding: 5% 5% 0; }
.btak__cd { position: relative; z-index: 3; width: min(560px, 100%); text-align: center; background: rgba(255,250,242,.94); color: #2b2b2b; border-radius: 18px; padding: clamp(1rem, 3vw, 1.8rem); box-shadow: 0 10px 30px rgba(0,0,0,.25); border-top: 5px solid var(--btak-active, #E8833F); }
.btak__cd-text { margin: 0 0 .9rem; font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: clamp(1.1rem, 3.2vw, 1.6rem); line-height: 1.25; }
.btak__cd-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(.4rem, 1.5vw, .9rem); }
.btak__cd-unit { background: #E8833F; color: #1f1f1f; border-radius: 12px; padding: .6rem .2rem .5rem; display: flex; flex-direction: column; align-items: center; }
.btak__cd-num { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: clamp(1.6rem, 6vw, 2.8rem); line-height: 1; font-variant-numeric: tabular-nums; }
.btak__cd-label { margin-top: .3rem; font-size: clamp(.65rem, 1.8vw, .85rem); text-transform: uppercase; letter-spacing: .04em; }
.btak__cd-date { margin: .9rem 0 0; font-size: .9rem; color: #555; }
.btak__cd-done { margin: .6rem 0 0; font-weight: 700; }
.btak__cd-done a { color: #b85a1c; }
.btak__editor-note { margin: 0 0 .6rem; padding: .5rem .8rem; background: #fff3cd; border: 1px solid #f0d68a; border-radius: 8px; font-size: .85rem; color: #5c4600; }
.btak__cd-hint { margin: .35rem 0 0; font-size: .95rem; font-weight: 600; color: #b85a1c; }
/* Ganzes Motiv im geöffneten Türchen zeigen (inkl. „Türchen“ und Nummer im Bild) */
.btak__inside.has-thumb { background-size: contain; background-position: center; background-color: #fbeedd; }
.btak__inside.has-thumb .btak__inside-n { display: none; }

/* Eigenes Hintergrundbild im Raster (ersetzt die eingebaute Szene) */
.btak--bgimg .btak__stage { background: #f3e2c8 var(--btak-bg) center / cover no-repeat; }
.btak--festive.btak--grid.btak--bgimg .btak__stage { padding: 4.5% 15% 6%; }
.btak--bgimg .btak__stage::before { display: none; }
@media (max-width: 640px) {
	.btak--bgimg .btak__stage { background-image: var(--btak-bg-m); }
	.btak--festive.btak--grid.btak--bgimg .btak__stage { padding: 10% 7% 26%; }
	.btak--bgimg .btak__logo { top: 1.6%; }
}

/* Szene vollständig sichtbar: Türchen enden über Bergen und Ballon */
.btak--festive.btak--grid:not(.btak--bgimg) .btak__stage { padding-bottom: 38%; }
@media (max-width: 640px) {
	.btak--festive.btak--grid:not(.btak--bgimg) .btak__stage { padding-bottom: 40%; }
}
