:root {
  --bg: #140d1c;
  --bg2: #1c1327;
  --card: #231830;
  --card2: #2e2140;
  --line: #3a2b50;
  --text: #f6eee3;
  --muted: #a99bb8;
  --orange: #ff7a1a;
  --orange2: #ffb347;
  --purple: #9b5de5;
  --green: #7bd389;
  --red: #ff5c6c;
  --radius: 18px;
  --nav-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(255, 122, 26, .22), transparent 70%),
    radial-gradient(600px 400px at 100% 100%, rgba(155, 93, 229, .14), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--orange2); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.15; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.block { display: block; }
.display { font-family: 'Creepster', 'Outfit', cursive; font-weight: 400; letter-spacing: .03em; color: var(--orange); text-shadow: 0 0 24px rgba(255, 122, 26, .45); }

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(var(--nav-h) + var(--safe-b) + 28px);
  position: relative;
  z-index: 1;
}

.bg-fx { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; opacity: .14; }
.bg-fx span { position: absolute; font-size: 42px; animation: float 18s ease-in-out infinite; }
.bg-fx span:nth-child(1) { top: 12%; left: -10%; }
.bg-fx span:nth-child(2) { top: 4%; right: 4%; font-size: 70px; animation: none; }
.bg-fx span:nth-child(3) { top: 60%; left: -10%; animation-delay: -9s; font-size: 30px; }
@keyframes float {
  0% { transform: translate(0, 0) rotate(-8deg); }
  50% { transform: translate(60vw, -40px) rotate(8deg); }
  100% { transform: translate(120vw, 20px) rotate(-8deg); }
}

/* ---------- Bausteine ---------- */

.card {
  background: linear-gradient(180deg, var(--card), var(--bg2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 14px;
}
.card h3 { margin-bottom: .6em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 0 18px;
  border-radius: 14px; border: 1px solid var(--line);
  background: var(--card2); color: var(--text);
  font-weight: 600; font-size: 1rem;
  transition: transform .08s, filter .15s;
  text-align: center;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; }
.btn-primary { background: linear-gradient(180deg, #ff8c33, #f26a0c); border-color: transparent; color: #1a0f05; box-shadow: 0 6px 20px rgba(255, 122, 26, .35); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--red); }
.btn-primary.btn-danger { color: #fff; background: var(--red); }
.btn-block { width: 100%; }
.btn-lg { min-height: 58px; font-size: 1.15rem; }
.btn-small { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.btn-row .btn { flex: 1 1 auto; }

.icon-btn { background: none; border: 0; width: 40px; height: 40px; border-radius: 12px; font-size: 1.2rem; color: var(--muted); flex: none; }
.icon-btn:active { background: var(--card2); }

input, textarea {
  width: 100%;
  font: inherit; font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 12px;
  outline: none;
}
input:focus, textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 122, 26, .2); }
textarea { resize: vertical; }
.label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin: 0 0 6px; }

.inline-form { display: flex; gap: 8px; }
.inline-form input { margin: 0; }
.inline-form .btn { flex: none; min-width: 52px; }
.emoji-input { width: 64px !important; flex: none; text-align: center; }

.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--card2); font-size: 20px; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: 14px; vertical-align: middle; }

.tag { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: rgba(255, 122, 26, .18); color: var(--orange2); font-weight: 600; }
.big-emoji { font-size: 56px; line-height: 1; margin-bottom: 10px; }
.page-title { font-size: 1.7rem; font-weight: 800; margin: 6px 0 14px; }
.back { display: inline-block; margin: 4px 0 6px; color: var(--muted); font-weight: 500; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 10px; }
.section-head h3 { margin: 0; }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.center-screen { min-height: 70vh; display: grid; place-content: center; text-align: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.announce { background: rgba(155, 93, 229, .18); border: 1px solid rgba(155, 93, 229, .45); border-radius: 14px; padding: 12px 14px; margin: 0 0 14px; font-weight: 600; }
.announce.ok { background: rgba(123, 211, 137, .14); border-color: rgba(123, 211, 137, .4); }
.announce.warn { background: rgba(255, 179, 71, .12); border-color: rgba(255, 179, 71, .4); font-weight: 500; }

.seg { display: flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin: 0 0 12px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 10px; padding: 10px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--card2); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }

.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 14px; scrollbar-width: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--bg2); border-radius: 99px; padding: 8px 14px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.chip.on, .chip:active { background: var(--orange); border-color: var(--orange); color: #1a0f05; }

.bar { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--orange), var(--orange2)); border-radius: 99px; transition: width .4s; }

.switch { width: 52px; height: 30px; border-radius: 99px; border: 0; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch.on { background: var(--orange); }
.switch.on span { transform: translateX(22px); }

/* ---------- Join ---------- */

.join { padding-top: 6vh; }
.join-hero { text-align: center; margin-bottom: 20px; }
.join-hero h1 { font-size: 2.6rem; }
.pumpkin-glow { font-size: 88px; line-height: 1; filter: drop-shadow(0 0 28px rgba(255, 122, 26, .7)); animation: flicker 3s infinite; }
@keyframes flicker {
  0%, 100% { filter: drop-shadow(0 0 28px rgba(255, 122, 26, .7)); }
  45% { filter: drop-shadow(0 0 18px rgba(255, 122, 26, .45)); }
  50% { filter: drop-shadow(0 0 34px rgba(255, 150, 40, .9)); }
  55% { filter: drop-shadow(0 0 22px rgba(255, 122, 26, .55)); }
}
.emoji-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 0 0 16px; }
.emoji-pick label { position: relative; }
.emoji-pick input { position: absolute; opacity: 0; pointer-events: none; }
.emoji-pick span { display: grid; place-items: center; aspect-ratio: 1; font-size: 26px; border-radius: 14px; background: var(--bg); border: 2px solid var(--line); cursor: pointer; transition: transform .1s; }
.emoji-pick input:checked + span { border-color: var(--orange); background: rgba(255, 122, 26, .15); transform: scale(1.06); }

/* ---------- Start ---------- */

.hero { margin: 4px 0 16px; }
.hero h1 { font-size: 2.3rem; margin: 0 0 4px; }
.hello { margin: 0 0 2px; font-weight: 600; color: var(--muted); }

.stepper { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; margin: 0 0 14px; position: relative; }
.stepper::before { content: ''; position: absolute; top: 20px; left: 12%; right: 12%; height: 2px; background: var(--line); }
.stepper li { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .75rem; color: var(--muted); position: relative; text-align: center; }
.stepper .dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--bg2); border: 2px solid var(--line); font-size: 18px; filter: grayscale(1); opacity: .6; }
.stepper .past .dot { filter: none; opacity: .8; border-color: var(--purple); }
.stepper .current { color: var(--text); font-weight: 700; }
.stepper .current .dot { filter: none; opacity: 1; border-color: var(--orange); background: rgba(255, 122, 26, .2); box-shadow: 0 0 0 5px rgba(255, 122, 26, .15); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(255, 122, 26, .05); } }

.phase-card { display: flex; gap: 14px; align-items: flex-start; border-color: rgba(255, 122, 26, .4); }
.phase-icon { font-size: 40px; line-height: 1; }
.phase-card h2 { font-size: 1.3rem; }
.phase-card p { color: var(--muted); }

.timer-card { text-align: center; }
.timer-label { font-weight: 600; color: var(--muted); }
.timer { font-size: 3.4rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; line-height: 1.1; margin: 4px 0 8px; }
.timer.urgent { color: var(--orange); animation: blink 1s infinite; }
.timer.done { color: var(--red); }
@keyframes blink { 50% { opacity: .55; } }
.timer-track { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.timer-bar { height: 100%; background: linear-gradient(90deg, var(--purple), var(--orange)); transition: width .5s linear; }
.timer-inline { font-variant-numeric: tabular-nums; color: var(--orange); margin-left: 6px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 4px; }
.stats div { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 6px; text-align: center; }
.stats b { display: block; font-size: 1.6rem; color: var(--orange2); }
.stats span { font-size: .78rem; color: var(--muted); }

.strip { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.strip-item { flex: none; width: 104px; height: 130px; border-radius: 14px; overflow: hidden; border: 0; padding: 0; background: var(--card); scroll-snap-align: start; }
.strip-item img { width: 100%; height: 100%; object-fit: cover; }

.people { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.person { display: flex; flex-direction: column; align-items: center; width: 62px; color: var(--text); font-size: .75rem; text-align: center; }
.person .avatar { width: 48px; height: 48px; font-size: 26px; margin-bottom: 4px; }
.person span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.info p { color: var(--muted); margin: 0; }
.invite { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.qr { background: #fff; padding: 8px; border-radius: 12px; flex: none; line-height: 0; }
.qr img, .qr canvas { display: block; }

/* ---------- Galerie ---------- */

.post { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 16px; overflow: hidden; }
.post-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 12px; }
.post-user { display: flex; gap: 10px; align-items: center; color: var(--text); }
.post-user b { display: block; }
.post-user small { color: var(--muted); font-size: .8rem; }
.post-img { display: block; width: 100%; border: 0; padding: 0; background: #000; }
.post-img img { width: 100%; max-height: 70vh; object-fit: cover; }
.post-caption { padding: 10px 14px 0; margin: 0; }
.reactions { display: flex; gap: 6px; padding: 10px 12px 12px; flex-wrap: wrap; }
.react { border: 1px solid var(--line); background: var(--bg2); border-radius: 99px; padding: 5px 10px; font-size: 1.05rem; display: inline-flex; gap: 4px; align-items: center; transition: transform .1s; }
.react span { font-size: .85rem; font-weight: 700; }
.react.on { border-color: var(--orange); background: rgba(255, 122, 26, .18); }
.react:active { transform: scale(1.25); }

.fab {
  position: fixed; right: max(16px, calc(50% - 264px)); bottom: calc(var(--nav-h) + var(--safe-b) + 18px);
  width: 60px; height: 60px; border-radius: 50%; border: 0; font-size: 26px; z-index: 5;
  background: linear-gradient(180deg, #ff8c33, #f26a0c); box-shadow: 0 8px 26px rgba(255, 122, 26, .5);
}

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; color: var(--text); padding: 0; text-align: left; }
.tile-img { aspect-ratio: 4 / 5; background: var(--bg2); display: grid; place-items: center; font-size: 48px; }
.tile-img img { width: 100%; height: 100%; object-fit: cover; }
.tile-img.white { background: #fff; aspect-ratio: 1; padding: 6px; }
.tile-img.white svg { width: 100%; height: 100%; }
.tile-txt { padding: 8px 10px 10px; }
.tile-txt b { display: block; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-txt small { color: var(--muted); font-size: .8rem; }

.pumpkin-hero { border-radius: 22px; overflow: hidden; background: var(--bg2); border: 1px solid var(--line); aspect-ratio: 4 / 5; display: grid; place-items: center; margin: 0 0 14px; font-size: 90px; text-align: center; }
.pumpkin-hero img { width: 100%; height: 100%; object-fit: cover; }
.pumpkin-hero p { font-size: 1rem; color: var(--muted); margin: -40px 0 0; }
.pumpkin-hero.mine { aspect-ratio: 1; }
.desc { font-size: 1.05rem; }

/* ---------- Voting ---------- */

.vote-progress b { color: var(--orange2); }
.vote-cat { margin: 0 0 20px; }
.vote-cat h3 { font-size: 1.15rem; }
.carousel { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 8px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.vote-card { flex: none; width: 140px; border: 2px solid var(--line); background: var(--card); border-radius: 16px; padding: 0 0 8px; overflow: hidden; text-align: left; scroll-snap-align: start; transition: transform .12s, border-color .12s; }
.vote-card b, .vote-card small { display: block; padding: 0 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vote-card b { font-size: .88rem; margin-top: 7px; }
.vote-card small { color: var(--muted); font-size: .76rem; }
.vote-img { aspect-ratio: 1; background: var(--bg2); display: grid; place-items: center; font-size: 42px; position: relative; }
.vote-img img { width: 100%; height: 100%; object-fit: cover; }
.vote-card.on { border-color: var(--orange); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(255, 122, 26, .3); }
.check { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: #1a0f05; display: grid; place-items: center; font-size: 18px; font-weight: 800; animation: pop .3s; }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
.cat-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-pill { background: var(--bg2); border: 1px solid var(--line); border-radius: 99px; padding: 8px 14px; font-weight: 600; }

/* ---------- Siegerehrung ---------- */

.award { text-align: center; }
.award-head { font-size: 1.15rem; font-weight: 800; margin-bottom: 10px; }
.award.locked { opacity: .65; }
.lock { color: var(--muted); padding: 10px 0; }
.ranking { text-align: left; padding: 0; list-style: none; margin: 12px 0; counter-reset: r; }
.ranking li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); counter-increment: r; }
.ranking li::before { content: counter(r) '.'; width: 20px; color: var(--muted); font-weight: 700; }
.ranking li span:last-child { margin-left: auto; font-weight: 700; color: var(--orange2); }
.ranking li .avatar { margin: 0; }

.winners { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 6px 0 4px; }
.winner { width: 170px; text-align: center; }
.winner-photo { position: relative; width: 150px; height: 150px; margin: 18px auto 10px; border-radius: 50%; border: 4px solid var(--orange); box-shadow: 0 0 40px rgba(255, 122, 26, .55); background: var(--bg2); display: grid; place-items: center; font-size: 60px; }
.winner-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.crown { position: absolute; top: -30px; left: 50%; transform: translateX(-50%) rotate(-8deg); font-size: 40px; }
.winner-name { font-weight: 800; font-size: 1.15rem; }
.winner-pumpkin { color: var(--muted); font-style: italic; }

/* ---------- Mehr ---------- */

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.mtile { background: linear-gradient(180deg, var(--card), var(--bg2)); border: 1px solid var(--line); border-radius: 18px; padding: 16px 14px; color: var(--text); display: flex; flex-direction: column; gap: 2px; min-height: 120px; }
.mtile:active { transform: scale(.98); }
.mtile-icon { font-size: 32px; margin-bottom: 6px; }
.mtile small { color: var(--muted); font-size: .8rem; line-height: 1.3; }

.idea-card { text-align: center; min-height: 240px; display: flex; flex-direction: column; justify-content: center; border-color: rgba(155, 93, 229, .5); }
.idea-pre { color: var(--muted); margin: 0; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; }
.idea-motif { font-family: 'Creepster', cursive; font-size: 2.1rem; color: var(--orange); margin: 4px 0 8px; line-height: 1.1; }
.idea-line { font-size: 1.1rem; margin: 0 0 4px; font-weight: 600; }
.idea-level { margin: 12px 0 0; color: var(--muted); }
.idea-level .dim { opacity: .25; }
.idea-card.rolling { animation: shake .16s infinite; }
@keyframes shake { 25% { transform: rotate(-1.5deg); } 75% { transform: rotate(1.5deg); } }

.items { list-style: none; padding: 0; margin: 0 0 14px; }
.item { display: flex; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin: 0 0 8px; }
.item-main { flex: 1; display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 12px; text-align: left; }
.item-main:disabled { cursor: default; color: inherit; }
.item-main small { display: block; color: var(--muted); font-size: .82rem; }
.check-box { width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; font-weight: 800; }
.item.taken { opacity: .6; }
.item.taken .check-box { background: var(--purple); border-color: var(--purple); }
.item.mine { opacity: 1; border-color: rgba(255, 122, 26, .5); }
.item.mine .check-box { background: var(--orange); border-color: var(--orange); color: #1a0f05; }

.guide { list-style: none; padding: 0; margin: 0 0 14px; }
.guide li { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.guide-icon { font-size: 28px; width: 44px; height: 44px; flex: none; display: grid; place-items: center; background: var(--card); border-radius: 14px; }
.guide p { color: var(--muted); margin: 2px 0 0; }
.recipe ol { padding-left: 20px; margin: 0; color: var(--muted); }
.recipe li { margin-bottom: 6px; }

.simple-list { list-style: none; padding: 0; margin: 0 0 12px; }
.simple-list li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.phase-btns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0 0 8px; }
.phase-btns button { border: 2px solid var(--line); background: var(--bg); border-radius: 14px; padding: 12px 6px; font-size: 22px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.phase-btns span { font-size: .85rem; font-weight: 700; }
.phase-btns .on { border-color: var(--orange); background: rgba(255, 122, 26, .15); }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.reveal-list { list-style: none; padding: 0; margin: 8px 0 12px; }
.reveal-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }

/* ---------- Navigation ---------- */

#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around; align-items: flex-end;
  height: calc(var(--nav-h) + var(--safe-b));
  padding: 0 6px var(--safe-b);
  background: rgba(20, 13, 28, .88);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
#tabs[hidden] { display: none; }
#tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--nav-h); color: var(--muted); font-size: .72rem; font-weight: 600; position: relative; max-width: 110px; }
#tabs svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
#tabs a.on { color: var(--orange); }
.tab-pumpkin { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; margin-top: -26px; background: linear-gradient(180deg, #ff8c33, #e85f05); box-shadow: 0 6px 20px rgba(255, 122, 26, .5), 0 0 0 5px var(--bg); }
#tabs .tab-main.on .tab-pumpkin { animation: flicker 3s infinite; }
#vote-dot { position: absolute; top: 12px; right: calc(50% - 18px); width: 10px; height: 10px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px var(--bg); }
#vote-dot[hidden] { display: none; }

/* ---------- Overlays ---------- */

#overlay { position: fixed; inset: 0; z-index: 50; display: none; }
#overlay.open { display: flex; }
.sheet-overlay { background: rgba(8, 4, 12, .7); align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--bg2); border-radius: 24px 24px 0 0; border: 1px solid var(--line); padding: 10px 16px calc(16px + var(--safe-b)); animation: up .25s ease-out; display: flex; flex-direction: column; gap: 10px; }
.sheet input { margin: 0; }
.sheet .btn-row { margin: 0; }
.sheet-handle { width: 44px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 4px; }
.sheet-preview { width: 100%; max-height: 46vh; object-fit: contain; border-radius: 14px; background: #000; }
.progress { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--orange); transition: width .2s; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

.lb-overlay { background: rgba(0, 0, 0, .95); animation: fade .2s; }
.lightbox { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 16px; }
.lightbox img { max-height: 82vh; object-fit: contain; border-radius: 10px; }
.lb-cap { margin-top: 12px; text-align: center; max-width: 520px; }

.stencil-overlay { background: #fff; }
.stencil-full { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #555; padding: 16px; }
.stencil-full svg { width: min(100vw, 82vh); height: auto; }

.reveal-overlay { background: radial-gradient(circle at 50% 40%, #3b1e57, #0b0610 70%); align-items: center; justify-content: center; animation: fade .4s; overflow-y: auto; }
.reveal { text-align: center; padding: 24px 16px; max-width: 640px; width: 100%; }
.reveal-emoji { font-size: 80px; line-height: 1; margin-bottom: 10px; animation: pop .5s; }
.reveal-emoji.small { font-size: 50px; }
.reveal-kicker { color: var(--muted); font-size: 1.1rem; margin: 0; }
.reveal-title { font-family: 'Creepster', cursive; font-weight: 400; font-size: 2.4rem; color: var(--orange); text-shadow: 0 0 30px rgba(255, 122, 26, .6); margin: 6px 0; }
.drum { font-size: 110px; font-weight: 800; margin-top: 20px; color: var(--text); }
.drum.pop { animation: pop .5s; }
.reveal-votes { color: var(--orange2); font-weight: 700; font-size: 1.1rem; }
.reveal .winner { animation: pop .6s; }
.reveal .btn { margin-top: 14px; min-width: 160px; }

#toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); z-index: 60;
  transform: translate(-50%, -150%); transition: transform .3s;
  background: var(--card2); border: 1px solid var(--line); color: var(--text);
  padding: 12px 18px; border-radius: 16px; font-weight: 600; max-width: calc(100vw - 32px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5); text-align: center;
}
#toast.show { transform: translate(-50%, 0); }
#toast.big { background: linear-gradient(180deg, #ff8c33, #f26a0c); color: #1a0f05; font-size: 1.05rem; border: 0; }
#toast.error { background: #4a1620; border-color: var(--red); }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 70; pointer-events: none; display: none; }

.offline-bar { position: fixed; bottom: calc(var(--nav-h) + var(--safe-b)); left: 0; right: 0; background: var(--red); color: #fff; text-align: center; font-size: .85rem; padding: 4px; z-index: 11; display: none; }
body.offline .offline-bar { display: block; }

.spinner { width: 40px; height: 40px; border: 4px solid var(--line); border-top-color: var(--orange); border-radius: 50%; margin: 20px auto; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Beamer ---------- */

body.is-beamer #app { max-width: none; padding: 0; }
body.is-beamer .bg-fx { opacity: .08; }
.beamer-wrap { display: grid; grid-template-columns: 1fr 360px; height: 100vh; gap: 0; cursor: pointer; }
.b-main { position: relative; overflow: hidden; background: #000; }
.b-slide, .b-empty { position: absolute; inset: 0; display: grid; place-items: center; }
.b-empty { text-align: center; color: var(--muted); font-size: 1.4rem; }
.b-img { width: 100%; height: 100%; object-fit: contain; animation: kenburns 7s ease-out; }
@keyframes kenburns { from { transform: scale(1.06); opacity: 0; } 15% { opacity: 1; } to { transform: scale(1); } }
.b-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 28px 22px; font-size: 1.6rem; background: linear-gradient(transparent, rgba(0, 0, 0, .8)); }
.b-side { background: var(--bg2); border-left: 1px solid var(--line); padding: 26px 22px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.b-side h1 { font-size: 2.4rem; margin: 0; }
.b-phase { font-size: 1.5rem; font-weight: 800; }
.b-side .timer { font-size: 4.4rem; }
.b-big { font-size: 2.6rem; font-weight: 800; color: var(--orange2); }
.b-stats { display: flex; gap: 20px; font-size: 1.4rem; font-weight: 700; }
.b-feed { color: var(--text); display: flex; flex-direction: column; gap: 6px; font-size: 1rem; }
.b-join { margin-top: auto; display: flex; gap: 14px; align-items: center; }
.b-join b { display: block; font-size: 1.4rem; }
.b-join small { color: var(--muted); }
.b-awards { position: absolute; inset: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 30px; padding: 30px; background: radial-gradient(circle at 50% 40%, #2b1640, #0b0610 75%); overflow-y: auto; }
.b-award { text-align: center; }
.b-award-head { font-size: 1.4rem; font-weight: 800; }
body.is-beamer .reveal { max-width: 1000px; }
body.is-beamer .reveal-title { font-size: 4.5rem; }
body.is-beamer .reveal-kicker { font-size: 1.8rem; }
body.is-beamer .drum { font-size: 200px; }
body.is-beamer .winner { width: 280px; }
body.is-beamer .winner-photo { width: 250px; height: 250px; }
body.is-beamer .winner-name { font-size: 2rem; }

@media (max-width: 800px) {
  .beamer-wrap { grid-template-columns: 1fr; grid-template-rows: 55vh auto; height: auto; }
  .b-side { border-left: 0; }
}

@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

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