/* Winternacht-Instagrammer – Farben/Schrift aus der Winternacht-CI (winternacht-erbendorf/webspace) */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(fonts/inter-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(fonts/inter-latin-ext.woff2) format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --black: #0B0F14; --midnight: #1F2E3B; --steel: #3F5566; --ice: #B7C4CF; --white: #F7F8FA;
  --line: rgba(183, 196, 207, .24); --line2: rgba(183, 196, 207, .12); --glow: #9fd8ff;
}
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { font-family: Inter, system-ui, sans-serif; color: var(--white); background: var(--black); }

/* ------------------------------------------------------------ TV */
/* Größen hängen an Bildschirmhöhe (vh) und Spaltenbreite (cqi) – so passt alles von 720p bis 4K,
   quer und hochkant, ohne Scrollen und ohne abgeschnittene Schrift. */
body.tv { overflow: hidden; background: radial-gradient(120% 90% at 20% 0%, var(--midnight) 0%, var(--black) 60%); }
.snow { position: fixed; inset: 0; pointer-events: none; opacity: .35;
  background-image: radial-gradient(2px 2px at 20% 30%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 70% 60%, #fff 50%, transparent 51%),
    radial-gradient(2.5px 2.5px at 40% 80%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 85% 20%, #fff 50%, transparent 51%);
  background-size: 320px 320px, 260px 260px, 400px 400px, 200px 200px; animation: snow 40s linear infinite; }
@keyframes snow { to { background-position: 0 320px, 0 260px, 0 400px, 0 200px; } }

.wall { position: relative; height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) max(320px, 30vw);
  gap: 2.5vmin; padding: 2.5vmin; }

/* Bühne: genau ein Beitrag, Fotos vollständig sichtbar (contain), unscharfe Kopie als Hintergrund */
.stage { position: relative; min-height: 0; border-radius: 3vmin; overflow: hidden; background: rgba(31, 46, 59, .35);
  border: 1px solid var(--line); container-type: size; }
.empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 3cqh; color: var(--ice); font-size: min(3.2cqw, 5cqh); padding: 4cqw; }
.empty-logo { width: min(60cqw, 50cqh); margin: 0 auto; }
.post.big { position: absolute; inset: 0; overflow: hidden; transition: opacity .9s ease, transform .9s ease; }
.post.big img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.post.big .bg { inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(40px) brightness(.45); }
.post.big.enter { opacity: 0; transform: scale(1.03); }
.post.big.leave { opacity: 0; }
.meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 8cqh 3.5cqw 4.5cqh;
  background: linear-gradient(to top, rgba(11, 15, 20, .94) 0%, rgba(11, 15, 20, .72) 55%, transparent 100%); }
.who { display: flex; flex-wrap: wrap; align-items: center; gap: .4em 1em; font-size: min(2.2cqw, 3.6cqh); margin-bottom: .5em; }
.user { font-weight: 700; }
.src { font-size: .8em; padding: .2em .8em; border-radius: 99px; border: 1px solid var(--line); color: var(--ice); }
.src-own { background: rgba(159, 216, 255, .15); border-color: rgba(159, 216, 255, .5); color: var(--white); }
.time { color: var(--ice); font-size: .85em; margin-left: auto; }
.caption { font-size: min(3cqw, 4.6cqh); line-height: 1.3; font-weight: 500; max-width: 60ch;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hl { color: var(--glow); }
.badge-new { position: absolute; top: 3cqh; left: 3cqh; padding: .3em 1em; border-radius: 99px; font-weight: 700; font-size: min(2.2cqw, 3.6cqh); letter-spacing: .15em;
  background: var(--white); color: var(--black); box-shadow: 0 0 40px rgba(159, 216, 255, .8); animation: pop 1.6s ease-in-out infinite; }
@keyframes pop { 50% { transform: scale(1.08); } }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: max(3px, .5cqh); background: rgba(247, 248, 250, .08); z-index: 2; }
.progress span { display: block; height: 100%; width: 0; background: var(--glow); opacity: .7; }
.status { position: absolute; top: 2cqh; right: 2cqw; font-size: max(11px, 1.3cqh); color: var(--steel); z-index: 2; }
body.demo .status { color: #ffcf6e; }

/* Mitmach-Spalte: alles zentriert, Schrift nach Spaltenbreite (cqi) und Höhe (vh) begrenzt */
.side { min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.5vh; container-type: inline-size; }
.logo { display: block; width: 78cqi; max-height: 12vh; object-fit: contain; flex: none; }
.join-card { width: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.6vh;
  padding: min(6cqi, 3.2vh) min(6cqi, 3vh); border-radius: min(6cqi, 3vh); background: rgba(247, 248, 250, .06); border: 1px solid var(--line);
  box-shadow: 0 0 60px rgba(159, 216, 255, .12) inset; }
.join-title { font-weight: 700; font-size: min(13cqi, 6.4vh); line-height: 1.05; }
.qr { width: min(80cqi, 40vh); aspect-ratio: 1; background: var(--white); border-radius: min(3cqi, 1.5vh); padding: min(2.5cqi, 1.2vh); flex: none; }
.qr svg { display: block; width: 100%; height: 100%; }
.join-steps { list-style: none; padding: 0; display: flex; flex-direction: column; align-items: flex-start; gap: .25em; counter-reset: s;
  font-size: min(6cqi, 2.9vh); color: var(--ice); line-height: 1.3; }
.join-steps li { counter-increment: s; white-space: nowrap; }
.join-steps li::before { content: counter(s); display: inline-grid; place-content: center; width: 1.45em; height: 1.45em; margin-right: .4em;
  border-radius: 50%; background: var(--white); color: var(--black); font-weight: 700; font-size: .8em; vertical-align: .1em; }
/* @-Name und Hashtag: 22 Zeichen müssen in eine Zeile passen → höchstens 6.6cqi */
.join-acc, .join-tag { font-weight: 700; line-height: 1.15; white-space: nowrap; color: var(--white); font-size: min(6.6cqi, 4.2vh); }
.join-tag { color: var(--glow); font-weight: 600; }

/* Hochkant-TV oder schmale Fenster: Bühne oben, Mitmachen unten */
@media (max-aspect-ratio: 1/1) {
  .wall { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .side { flex-direction: row; gap: 3vw; container-type: inline-size; }
  .logo { display: none; }
  .join-card { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "qr title" "qr steps" "qr acc" "qr tag";
    align-items: center; justify-items: start; text-align: left; column-gap: 4cqi; row-gap: 1vh; }
  .join-title { grid-area: title; font-size: min(8cqi, 4.4vh); }
  .qr { grid-area: qr; width: min(36cqi, 24vh); }
  .join-steps { grid-area: steps; justify-content: start; font-size: min(3.4cqi, 2vh); }
  .join-acc { grid-area: acc; font-size: min(4.2cqi, 2.8vh); }
  .join-tag { grid-area: tag; font-size: min(4.2cqi, 2.8vh); }
}
@media (prefers-reduced-motion: reduce) { .snow, .badge-new { animation: none; } .post.big { transition: none; } .progress span { transition: none !important; } }

/* ------------------------------------------------------------ Mitmach-Seite (Handy) */
body.join { min-height: 100vh; background: radial-gradient(140% 70% at 50% 0%, var(--midnight) 0%, var(--black) 70%); }
.join main { max-width: 480px; margin: 0 auto; padding: 24px 16px 40px; display: flex; flex-direction: column; gap: 18px; }
.join .logo { max-height: 120px; }
.join h1 { font-size: 26px; line-height: 1.2; text-align: center; }
.join .lead { color: var(--ice); text-align: center; line-height: 1.45; }
.step { padding: 16px; border-radius: 18px; background: rgba(247, 248, 250, .06); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.step h2 { font-size: 17px; display: flex; gap: 10px; align-items: center; }
.step h2 .n { display: inline-grid; place-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--white); color: var(--black); font-size: 15px; flex: none; }
.step p { color: var(--ice); font-size: 15px; line-height: 1.45; }
.cap { font: 500 15px/1.45 Inter, sans-serif; padding: 12px; border-radius: 12px; background: var(--black); border: 1px dashed var(--line); color: var(--white); white-space: pre-wrap; }
.btn { display: block; width: 100%; padding: 15px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(247, 248, 250, .08);
  color: var(--white); font: 600 16px Inter, sans-serif; text-align: center; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--white); color: var(--black); border-color: var(--white); }
.btn:active { transform: scale(.98); }
.hint { font-size: 13px; color: var(--steel); line-height: 1.5; text-align: center; }
.hint a { color: var(--ice); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 18px; border-radius: 99px; background: var(--white); color: var(--black);
  font-weight: 600; font-size: 14px; opacity: 0; transition: opacity .3s; pointer-events: none; }
.toast.show { opacity: 1; }
