/* =====================================================================
   Skatepark – Beteiligung · im Design der neuen Jugend-Bregenz-Website
   Farben, Schrift und Radien laut Design-System „Jugend Bregenz“.
   ===================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --petrol: #198D9F;
  --petrol-dark: #157482;     /* für kleine weiße Schrift auf Petrol (5,0:1) */
  --petrol-50: #8CC6CF;
  --petrol-12: rgba(25,141,159,.12);
  --gelb: #FFEA00;
  --ink: #201E1D;
  --text: #333333;
  --muted: #444141;
  --bg: #F3F2F2;
  --surface: #FFFFFF;
  --stadtblau: #0069AF;
  --stadtblau-hell: #DCEEF9;
  --linie: #E8E6E6;
  --bildflaeche: #D0E3E6;
  --danger: #C62828;
  --ok: #1E8E4E;

  --r-gross: 28px;
  --r-karte: 22px;
  --r-icon: 14px;
  --r-klein: 12px;

  --tap: 48px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: clamp(15px, 0.5vw + 8.5px, 21px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  overscroll-behavior: none; user-select: none; line-height: 1.4;
}
input, textarea, select, .note, .qr-url { user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
svg.i { width: 1.25em; height: 1.25em; flex: none; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--stadtblau); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
h1, h2, h3 { color: var(--ink); font-weight: 800; text-transform: uppercase; letter-spacing: -.025em; line-height: 1.05; }
.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ---------- App-Gerüst ---------- */
#app { height: 100vh; display: flex; flex-direction: column; }
main#view { flex: 1; min-height: 0; overflow: auto; }
.page { padding: 1.5rem 1.5rem 2.5rem; max-width: 1480px; margin: 0 auto; }
.page > h1 { font-size: clamp(28px, 3vw, 44px); margin: .4rem 0 1.2rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: var(--tap); padding: 0 1.25em; border-radius: 999px; border: 0;
  background: var(--surface); color: var(--ink); font-weight: 700; font-size: .95rem;
  white-space: nowrap; text-decoration: none; transition: transform .08s ease, background .15s;
}
.btn:active { transform: scale(.97); }
.btn:hover { background: #fafafa; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { background: #000; }
.btn.primary { background: var(--gelb); color: var(--ink); font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }
.btn.primary:hover { background: #ffe100; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 2px rgba(32,30,29,.15); }
.btn.on-dark { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
.btn.danger { color: var(--danger); background: var(--surface); }
.btn.danger.solid { background: var(--danger); color: #fff; }
.btn.big { min-height: 60px; font-size: 1.1rem; padding: 0 1.6em; }
.btn.huge { min-height: 88px; font-size: 1.6rem; padding: 0 2.2em; }
.btn:disabled { opacity: .35; pointer-events: none; }
.icon-btn {
  width: var(--tap); height: var(--tap); border-radius: 50%; border: 0; background: var(--surface); color: var(--ink);
  display: inline-grid; place-items: center; flex: none;
}
.icon-btn:hover { background: var(--petrol-12); }
.badge {
  display: inline-grid; place-items: center; min-width: 1.7em; height: 1.7em; padding: 0 .45em;
  border-radius: 999px; background: var(--ink); color: #fff; font-size: .75rem; font-weight: 800;
}

/* ---------- Menüleiste ---------- */
.topbar {
  display: flex; align-items: center; gap: 1.2rem; flex: none;
  padding: 14px 1.5rem; background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.logo-text { font-size: 22px; line-height: .98; font-weight: 800; letter-spacing: -.02em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.logo-img { height: 52px; width: auto; }
.brand-app { border-left: 2px solid var(--linie); padding-left: 1rem; min-width: 0; }
.brand-app .eyebrow { display: block; }
.brand-title { font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 24vw; }
.tabs { display: flex; gap: .2rem; margin-left: auto; }
.tab {
  min-height: 44px; padding: 0 1em; border-radius: 999px; border: 0; background: transparent;
  color: var(--ink); font-weight: 800; font-size: .85rem; letter-spacing: .02em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: .45em;
}
.tab:hover { background: var(--petrol-12); }
.tab.on { background: var(--gelb); }
.top-actions { display: flex; gap: .5rem; align-items: center; }
.top-actions .btn, .top-actions .icon-btn { background: var(--bg); }
.top-actions .btn.primary { background: var(--gelb); }

/* ---------- Footer (Stadt-CI) ---------- */
.cifoot {
  flex: none; background: var(--stadtblau); color: #fff; border-top: 8px solid var(--petrol);
  padding: .55rem 1.5rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  font-size: .8rem; font-weight: 600;
}
.cifoot b { font-weight: 800; text-transform: uppercase; letter-spacing: -.01em; font-size: .95rem; }
.cifoot > span { color: var(--stadtblau-hell); }
body.present .topbar, body.present .cifoot { display: none; }

/* ---------- Kopfbereich (Hero, kompakt) ---------- */
.hero {
  background: linear-gradient(90deg, var(--petrol) 0%, var(--petrol) 55%, #1f9fb2 100%);
  border-radius: var(--r-gross); color: #fff; padding: clamp(18px, 2.2vw, 30px) clamp(22px, 3vw, 40px);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.hero h1 { color: #fff; margin: 0; font-size: clamp(34px, 4.6vw, 72px); line-height: .92; letter-spacing: -.04em; }
.hero p { margin: .5rem 0 0; font-size: 1.05rem; font-weight: 600; max-width: 46ch; }
.hero .hero-actions { display: flex; gap: .5rem; flex-wrap: wrap; position: relative; z-index: 1; }

/* ---------- Ideenwand ---------- */
.board-wrap { display: flex; flex-direction: column; height: 100%; padding: 1.2rem 1.5rem 0; gap: 1rem; }
.board-toolbar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; color: var(--ink); min-height: 42px; padding: 0 1.1em; border-radius: 999px; font-weight: 700; font-size: .9rem; display: inline-flex; align-items: center; gap: .4em; }
.seg button.on { background: var(--gelb); font-weight: 800; }
.board {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: repeat(var(--cols), minmax(270px, 1fr));
  gap: 16px; padding-bottom: 1.2rem; overflow-x: auto;
}
.col { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-radius: var(--r-karte); overflow: hidden; }
.col-head { display: flex; align-items: center; gap: .75rem; padding: 1rem 1rem .8rem; }
.col-letter {
  width: 48px; height: 48px; border-radius: var(--r-icon); display: grid; place-items: center; flex: none;
  background: var(--c); color: #fff; font-weight: 800; font-size: 1.4rem;
}
.col-head h2 { margin: 0; font-size: clamp(20px, 1.6vw, 28px); flex: 1; }
.count { color: var(--ink); font-weight: 800; font-size: .8rem; background: var(--bg); min-width: 2em; text-align: center; padding: .3em .7em; border-radius: 999px; }
.col-body { overflow-y: auto; padding: 0 .8rem .8rem; display: flex; flex-direction: column; gap: .6rem; }
.cell { background: var(--bg); border-radius: var(--r-icon); padding: .65rem; }
.cell-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .55rem; }
.cell-head .ct { font-weight: 800; text-transform: uppercase; font-size: .9rem; letter-spacing: -.01em; color: var(--ink); display: flex; align-items: center; gap: .5em; }
.cell-head .code { font-size: .72rem; font-weight: 800; background: var(--c); color: #fff; border-radius: 6px; padding: .15em .45em; letter-spacing: .02em; }
.cell-head .count { background: var(--surface); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .45rem; }
.empty { color: var(--muted); font-size: .85rem; padding: .2rem; opacity: .7; }
.thumb {
  position: relative; aspect-ratio: 1; border-radius: var(--r-klein); overflow: hidden; padding: 0; border: 0;
  background: var(--bildflaeche);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: filter .2s; }
.thumb .star {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%;
  display: none; place-items: center; background: var(--gelb); color: var(--ink);
}
.thumb .star svg.i { width: 16px; height: 16px; fill: var(--ink); stroke-width: 1.5; }
.thumb.voted { outline: 4px solid var(--gelb); outline-offset: -4px; }
.thumb.voted .star { display: grid; }
.thumb .tag {
  position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px); font-size: .7rem; font-weight: 700;
  background: var(--ink); color: #fff; border-radius: 999px; padding: .3em .7em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thumb.new::after {
  content: "NEU"; position: absolute; top: 6px; left: 6px; font-size: .68rem; font-weight: 800;
  background: var(--gelb); color: var(--ink); padding: .25em .6em; border-radius: 999px;
}
/* Eingang: Vorschau verdeckt, bis man das Bild öffnet */
.thumb.veiled img { filter: blur(18px) saturate(.6); transform: scale(1.15); }
.thumb.veiled .veil {
  position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink);
  font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em;
}
.thumb.veiled .veil span { background: rgba(255,255,255,.88); padding: .45em .9em; border-radius: 999px; display: inline-flex; align-items: center; gap: .4em; }

/* ---------- Boxen ---------- */
.grid-lg { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.grid-lg .thumb { aspect-ratio: 16/10; }
.section { background: var(--surface); border-radius: var(--r-gross); padding: clamp(18px, 2vw, 28px); margin-bottom: 16px; }
.section.petrol50 { background: var(--petrol-50); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.section-head h2, .section h2 { margin: 0; font-size: clamp(20px, 1.8vw, 30px); }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.hint-box { background: var(--gelb); border-radius: var(--r-karte); padding: .9rem 1.1rem; display: flex; gap: .7rem; align-items: flex-start; color: var(--ink); font-weight: 500; }

/* ---------- Modal ---------- */
#modal-root:empty { display: none; }
.modal-bg {
  position: fixed; inset: 0; z-index: 50; background: rgba(32,30,29,.6);
  display: grid; place-items: center; padding: 2vh 2vw; animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0 } }
.modal { background: var(--surface); border-radius: var(--r-gross); max-width: 96vw; max-height: 96vh; overflow: auto; animation: pop .18s ease; }
@keyframes pop { from { transform: scale(.97); opacity: 0 } }
.modal.small { width: min(540px, 94vw); padding: 1.8rem; }
.modal h2 { margin: 0 0 .6rem; font-size: 1.6rem; }
.img-modal { width: 94vw; height: 92vh; display: grid; grid-template-columns: 1fr minmax(340px, 27rem); overflow: hidden; }
.img-stage { position: relative; background: var(--ink); display: grid; place-items: center; min-height: 0; }
.img-stage img { max-width: 100%; max-height: 92vh; object-fit: contain; }
.img-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink); display: grid; place-items: center; }
.img-nav svg.i { width: 30px; height: 30px; }
.img-nav.prev { left: 16px; } .img-nav.next { right: 16px; }
.img-side { padding: 1.4rem; overflow-y: auto; display: flex; flex-direction: column; gap: .35rem; }
.img-side h4 { margin: 1rem 0 .45rem; }
.side-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.side-head .icon-btn { background: var(--bg); }
.side-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.side-actions .btn { background: var(--bg); }
.side-actions .btn.primary { background: var(--gelb); }
.note { background: var(--petrol-50); border-radius: var(--r-icon); padding: .8rem 1rem; color: var(--ink); font-weight: 500; }

/* ---------- Chips / Pills ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 0 1em; border-radius: 999px; border: 0;
  background: var(--bg); color: var(--ink); font-weight: 600; font-size: .9rem;
  display: inline-flex; align-items: center; gap: .5em; --c: var(--muted);
}
.chip .dot { width: .7em; height: .7em; border-radius: 50%; background: var(--c); flex: none; }
.chip.on { background: var(--gelb); font-weight: 800; }
.chip.dashed { background: transparent; box-shadow: inset 0 0 0 2px var(--linie); color: var(--muted); }
.chip.dashed.on { background: var(--gelb); box-shadow: none; color: var(--ink); }
.toggle {
  min-height: var(--tap); border-radius: 999px; border: 0; background: var(--bg); color: var(--ink);
  text-align: left; padding: 0 1.2em; font-weight: 700; display: flex; align-items: center; gap: .6em;
}
.toggle.on { background: var(--gelb); font-weight: 800; }
.toggle.on svg.i { fill: var(--ink); }
.pill { font-size: .72rem; font-weight: 800; padding: .4em .9em; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; background: var(--bg); color: var(--ink); display: inline-flex; align-items: center; gap: .4em; vertical-align: middle; }
.pill.pending, .pill.draft { background: var(--gelb); }
.pill.approved, .pill.open { background: var(--petrol); color: #fff; }
.pill.rejected, .pill.closed { background: var(--bg); color: var(--muted); }
.pill.open::before { content: ""; width: .6em; height: .6em; border-radius: 50%; background: var(--gelb); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .2 } }

/* ---------- Formulare ---------- */
label.field { display: flex; flex-direction: column; gap: .45rem; }
label.field > .eyebrow { color: var(--ink); }
.input, textarea.input, select.input {
  min-height: 52px; padding: .65em 1.1em; border-radius: var(--r-icon); border: 0;
  background: var(--bg); color: var(--ink); font: inherit; font-weight: 500; width: 100%;
}
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { outline: 3px solid var(--stadtblau); outline-offset: 0; }
.input.num { width: 7em; text-align: center; font-weight: 800; font-size: 1.2rem; }
.switch { display: flex; align-items: center; gap: .8rem; min-height: var(--tap); font-weight: 600; cursor: pointer; color: var(--ink); }
.switch input { display: none; }
.switch .sw { width: 58px; height: 34px; border-radius: 999px; background: #d8d5d5; position: relative; transition: background .15s; flex: none; }
.switch .sw::after { content: ""; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .sw { background: var(--petrol); }
.switch input:checked + .sw::after { transform: translateX(24px); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }

/* ---------- Konzept-Editor ---------- */
.concept-edit { border-radius: var(--r-karte); padding: 1rem; margin-bottom: 12px; background: var(--bg); }
.concept-edit .icon-btn { background: var(--surface); }
.cat-list { display: flex; flex-direction: column; gap: .45rem; margin: .8rem 0 .2rem 3.6rem; }
.cat-list .input, .concept-edit .input { background: var(--surface); }
.cat-code { width: 2.6rem; font-weight: 800; color: var(--muted); font-size: .85rem; }
input[type=color] { width: var(--tap); height: var(--tap); border: 0; border-radius: var(--r-icon); background: var(--surface); padding: 6px; }

/* ---------- Abstimmungen ---------- */
.round-card { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; background: var(--surface); border-radius: var(--r-karte); padding: 1.1rem 1.3rem; margin-bottom: 12px; }
.round-card h3 { margin: 0 0 .35rem; font-size: 1.25rem; display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.round-card .btn, .round-card .icon-btn { background: var(--bg); }
.round-card .btn.primary { background: var(--gelb); }
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mode-card { text-align: left; padding: 1.1rem 1.3rem; border-radius: var(--r-karte); border: 0; background: var(--bg); color: var(--text); }
.mode-card strong { display: block; font-size: 1.15rem; margin-bottom: .35rem; text-transform: uppercase; font-weight: 800; color: var(--ink); }
.mode-card.on { background: var(--gelb); color: var(--ink); }
.pick .thumb img { opacity: .4; }
.pick .thumb.sel img { opacity: 1; }
.pick .thumb.sel { outline: 4px solid var(--gelb); outline-offset: -4px; }
.pick .thumb .check { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.9); display: grid; place-items: center; color: transparent; }
.pick .thumb.sel .check { background: var(--gelb); color: var(--ink); }
.sticky-foot { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 35%); padding: 1.4rem 0 .4rem; display: flex; gap: .6rem; justify-content: flex-end; }
.sticky-foot .btn:not(.primary) { background: var(--surface); }

/* ---------- Abstimmungsmodus (Kiosk) ---------- */
.kiosk { height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.k-top { display: flex; align-items: center; gap: 1rem; padding: 14px 1.5rem; background: var(--surface); flex: none; }
.k-top h1 { margin: 0; font-size: clamp(22px, 1.8vw, 32px); flex: 1; }
.k-top .k-rules { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 1rem; color: var(--text); margin-top: .3rem; }
.k-top .btn { background: var(--bg); }
.k-top .btn.primary { background: var(--gelb); }
.k-meter { display: flex; align-items: center; gap: .7rem; font-weight: 800; color: var(--ink); }
.k-dots { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; max-width: 36vw; }
.k-dot { min-width: 2em; height: 2em; padding: 0 .4em; border-radius: 999px; display: grid; place-items: center; background: var(--gelb); color: var(--ink); font-weight: 800; font-size: .9rem; transition: all .2s; }
.k-dot.used { background: var(--bg); color: #b9b5b5; }
.k-body { flex: 1; overflow: auto; padding: 1.2rem 1.5rem 2rem; display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(240px, 1fr)); gap: 16px; align-items: start; }
.k-group { background: var(--surface); border-radius: var(--r-karte); padding: 1rem; }
.k-group h2 { display: flex; align-items: center; gap: .7rem; margin: 0 0 .9rem; font-size: clamp(20px, 1.6vw, 28px); }
.k-group h2 .col-letter { width: 40px; height: 40px; font-size: 1.15rem; }
.k-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.k-card { position: relative; border-radius: var(--r-karte); overflow: hidden; background: var(--bg); padding: 0; text-align: left; transition: transform .1s; cursor: pointer; }
.k-card:active { transform: scale(.98); }
.k-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--bildflaeche); }
.k-card .k-cap { padding: .6rem .85rem; font-weight: 800; font-size: .85rem; text-transform: uppercase; color: var(--ink); display: flex; justify-content: space-between; gap: .5rem; }
.k-card .k-cap .muted { font-weight: 600; text-transform: none; }
.k-card .k-pts {
  position: absolute; top: 10px; right: 10px; min-width: 56px; height: 56px; padding: 0 .4em; border-radius: var(--r-icon);
  background: var(--gelb); color: var(--ink); font-weight: 800; font-size: 1.5rem; display: none; place-items: center;
}
.k-card.has { outline: 5px solid var(--gelb); outline-offset: -5px; }
.k-card.has .k-pts { display: grid; }
.k-card .k-minus, .k-card .k-zoom {
  position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 0;
  background: var(--surface); color: var(--ink); display: grid; place-items: center;
}
.k-card .k-zoom { top: 10px; left: 10px; }
.k-card .k-minus { right: 14px; bottom: 54px; display: none; }
.k-card.has .k-minus { display: grid; }
.k-card.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px) } 75% { transform: translateX(6px) } }

.k-stage { flex: 1; padding: 1.5rem; display: flex; }
.k-hero {
  flex: 1; border-radius: var(--r-gross); background: var(--petrol); color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(28px, 4vw, 64px);
  position: relative; overflow: hidden;
}
.k-hero::after { content: ""; position: absolute; right: -8vw; top: -8vw; width: 40vw; height: 40vw; border-radius: 50%; background: rgba(255,255,255,.07); }
.k-hero .eyebrow { color: #fff; font-size: 1rem; }
.k-hero h1 { color: #fff; font-size: clamp(56px, 8vw, 150px); line-height: .9; letter-spacing: -.04em; margin: .5rem 0 1.2rem; }
.k-hero p { font-size: 1.35rem; font-weight: 600; margin: 0 0 2rem; max-width: 46ch; }
.k-hero p b { background: var(--gelb); color: var(--ink); padding: 0 .3em; border-radius: 6px; }
.k-hero .btn.primary { align-self: flex-start; position: relative; z-index: 1; }
.k-hero.done { background: var(--gelb); color: var(--ink); }
.k-hero.done h1 { color: var(--ink); }
.k-hero .k-foot { margin-top: 2rem; font-weight: 700; font-size: 1rem; }
.k-check { width: 120px; height: 120px; border-radius: var(--r-gross); background: var(--ink); color: var(--gelb); display: grid; place-items: center; animation: popin .4s cubic-bezier(.2,1.6,.4,1); }
.k-check svg.i { width: 64px; height: 64px; stroke-width: 3; }
@keyframes popin { from { transform: scale(.3); opacity: 0 } }
.k-lock { position: fixed; right: 18px; bottom: 18px; z-index: 5; }
.k-idle { position: fixed; inset: 0; z-index: 70; background: rgba(32,30,29,.7); display: grid; place-items: center; }
.k-idle .modal { padding: 2.2rem; text-align: center; width: min(560px, 92vw); }
.k-idle .num { font-size: 4rem; font-weight: 800; color: var(--petrol); line-height: 1; margin: .4rem 0 1rem; }
.zoom-bg { position: fixed; inset: 0; z-index: 60; background: rgba(32,30,29,.92); display: grid; place-items: center; }
.zoom-bg img { max-width: 94vw; max-height: 90vh; object-fit: contain; border-radius: var(--r-karte); }

/* ---------- PIN ---------- */
.pin-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem; background: var(--bg); }
.pin-box { width: min(440px, 92vw); text-align: center; }
.pin-wrap .pin-box { background: var(--surface); border-radius: var(--r-gross); padding: 2rem; }
.pin-box h2 { margin: .4rem 0 .2rem; font-size: 1.6rem; }
.pin-display { display: flex; justify-content: center; gap: .8rem; margin: 1.4rem 0 .6rem; min-height: 22px; }
.pin-display span { width: 20px; height: 20px; border-radius: 50%; background: var(--bg); }
.pin-display span.f { background: var(--petrol); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-pad button { height: 72px; border-radius: var(--r-karte); border: 0; background: var(--bg); color: var(--ink); font-size: 1.6rem; font-weight: 800; }
.pin-pad button:active { background: var(--petrol-50); }
.pin-pad button.ok { background: var(--gelb); }
.pin-err { color: var(--danger); min-height: 1.4em; font-weight: 700; }

/* ---------- Ergebnisse ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat { background: var(--petrol-50); border-radius: var(--r-karte); padding: 1.1rem 1.3rem; }
.stat .v { font-size: clamp(32px, 3vw, 52px); font-weight: 800; letter-spacing: -.03em; color: var(--ink); line-height: 1.05; }
.stat .eyebrow { color: var(--ink); }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; align-items: end; }
.pod { background: var(--surface); border-radius: var(--r-karte); overflow: hidden; position: relative; }
.pod img { width: 100%; aspect-ratio: 16/10; object-fit: cover; cursor: zoom-in; }
.pod.p1 { outline: 5px solid var(--gelb); outline-offset: -5px; }
.pod .place { position: absolute; top: 12px; left: 12px; width: 56px; height: 56px; border-radius: var(--r-icon); background: var(--gelb); color: var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 1.6rem; }
.pod.p2 .place, .pod.p3 .place { background: var(--surface); }
.pod .info { padding: .9rem 1.1rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.pod .pts { font-size: 2rem; font-weight: 800; color: var(--ink); }
.rank-row { display: grid; grid-template-columns: 3rem 96px 1fr 6rem; gap: 1rem; align-items: center; padding: .65rem .2rem; border-bottom: 1px solid var(--linie); }
.rank-row:last-child { border-bottom: 0; }
.rank-row .n { font-weight: 800; font-size: 1.2rem; color: var(--ink); text-align: center; }
.rank-row img { width: 96px; height: 60px; object-fit: cover; border-radius: var(--r-klein); cursor: zoom-in; }
.rank-row .bar { height: 14px; border-radius: 7px; background: var(--bg); overflow: hidden; margin-top: .4rem; }
.rank-row .bar i { display: block; height: 100%; background: var(--c, var(--petrol)); border-radius: 7px; transition: width .5s ease; }
.rank-row .p { text-align: right; font-weight: 800; font-size: 1.4rem; color: var(--ink); }
.ctag { display: inline-flex; align-items: center; gap: .45em; font-weight: 800; font-size: .88rem; color: var(--ink); text-transform: uppercase; letter-spacing: -.01em; }
.ctag::before { content: ""; width: .75em; height: .75em; border-radius: 4px; background: var(--c); flex: none; }
.res-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Toast ---------- */
#toast { position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: .85rem 1.4rem; border-radius: 999px; font-weight: 700; animation: pop .2s ease; }
.toast.err { background: var(--danger); }

/* ---------- QR ---------- */
.qr-modal { padding: 0; width: min(680px, 94vw); overflow: hidden; }
.qr-modal .qr-head { background: var(--petrol); color: #fff; padding: 1.6rem 2rem; }
.qr-modal .qr-head h2 { color: #fff; font-size: clamp(30px, 3.4vw, 48px); margin: 0; letter-spacing: -.03em; }
.qr-modal .qr-head p { margin: .4rem 0 0; font-weight: 600; font-size: 1.1rem; }
.qr-modal .qr-body { padding: 1.6rem 2rem 2rem; text-align: center; }
.qr-box { background: #fff; padding: 12px; border-radius: var(--r-karte); width: min(420px, 60vh); margin: 0 auto; }
.qr-box svg { width: 100%; height: auto; display: block; }
.qr-url { word-break: break-all; text-align: center; color: var(--muted); font-size: .85rem; margin-top: .6rem; }

@media (max-width: 1180px) {
  .brand-app { display: none; }
  .tab { padding: 0 .7em; }
}
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; }
  .tabs { order: 3; width: 100%; overflow-x: auto; margin: 0; }
  .img-modal { grid-template-columns: 1fr; grid-template-rows: 46vh auto; height: 94vh; overflow-y: auto; }
  .podium, .res-cols, .mode-cards { grid-template-columns: 1fr; }
  .rank-row { grid-template-columns: 2rem 72px 1fr 3.5rem; }
  .rank-row img { width: 72px; height: 45px; }
  .cifoot > span { display: none; }
}

/* ---------- Ergänzungen v4 ---------- */
.tab-icon { width: 44px; padding: 0; justify-content: center; }
.tab-icon svg.i { width: 22px; height: 22px; }
.login-box { text-align: left; }
.login-box h2 { margin-top: 0; }
.all-wrap { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 1.2rem; }
.all-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.all-grid .thumb { aspect-ratio: 4/3; border-radius: var(--r-karte); }
.all-grid .thumb .tag { font-size: .78rem; bottom: 10px; left: 10px; }
.k-countdown { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; border-radius: 999px; background: var(--gelb); color: var(--ink); font-size: .8em; margin-left: .3em; }
.k-foot-bar { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 1.5rem; background: var(--surface); font-weight: 700; color: var(--muted); font-size: .9rem; }
.k-lock-inline { background: var(--bg); min-height: 40px; font-size: .85rem; }
.hero-actions .btn:not(.primary) { background: #fff; }

/* ---------- Ergänzungen v5: Quellen, Hochlade-Dialog, Beschreibungen ---------- */
.seg-light { background: var(--bg); align-self: flex-start; }
.seg-light button.on { background: var(--gelb); }
.source-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: var(--bg); border-radius: var(--r-karte); padding: .7rem .8rem; margin-bottom: 10px; }
.source-row .input, .source-row .btn, .source-row .icon-btn, .source-row .count { background: var(--surface); }
.source-row.off { opacity: .6; }
.note-edit { min-height: 70px; font-size: .95rem; background: var(--petrol-50); }
.note-edit.internal { background: var(--gelb); }
.stage-modal { width: min(1200px, 96vw); height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.stage-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.4rem 1.6rem 1rem; }
.stage-head .icon-btn { background: var(--bg); }
.stage-body { flex: 1; overflow-y: auto; padding: 0 1.6rem 1rem; display: flex; flex-direction: column; gap: 12px; }
.stage-source { background: var(--petrol-50); border-radius: var(--r-karte); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .6rem; }
.stage-source .chip { background: var(--surface); }
.stage-source .chip.on { background: var(--gelb); }
.stage-item { display: grid; grid-template-columns: 220px 1fr; gap: 1.1rem; background: var(--bg); border-radius: var(--r-karte); padding: .9rem; }
.stage-item .chip { background: var(--surface); }
.stage-item .chip.on { background: var(--gelb); }
.stage-item .input { background: var(--surface); }
.stage-img { position: relative; }
.stage-img img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--r-icon); background: var(--bildflaeche); }
.stage-img .icon-btn { position: absolute; top: 8px; right: 8px; }
.stage-fields { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.missing { box-shadow: inset 0 0 0 3px var(--danger); }
.missing::after { content: "Bitte ergänzen"; color: var(--danger); font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.stage-item.missing::after { grid-column: 1 / -1; }
.stage-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: 1rem 1.6rem; border-top: 1px solid var(--linie); }
@media (max-width: 900px) { .stage-item { grid-template-columns: 1fr; } }
.modal-bg.still, .modal.still { animation: none; }

/* ---------- Hinweise & Disclaimer + Version (v1.1) ---------- */
.hints-btn {
  display: inline-flex; align-items: center; gap: .45em; min-height: 36px; padding: 0 1em; border-radius: 999px;
  border: 0; background: rgba(255,255,255,.14); color: #fff; font-weight: 700; font-size: .82rem; cursor: pointer;
  list-style: none;
}
.hints-btn::-webkit-details-marker { display: none; }
.hints-btn:hover { background: rgba(255,255,255,.24); }
.hints-btn svg.i { width: 1.2em; height: 1.2em; color: var(--gelb); }
.cifoot .hints-btn { margin: 0 auto; }
.hints-modal p { margin: .2rem 0 .8rem; color: var(--text); line-height: 1.55; }
.hints-modal h4 { margin: 1rem 0 .2rem; }
.k-foot-bar .hints-btn { background: var(--bg); color: var(--ink); }
.k-foot-bar .hints-btn svg.i { color: var(--petrol); }
.k-right { display: flex; align-items: center; gap: 1rem; }
.k-ver { font-size: .78rem; color: var(--muted); font-weight: 600; }
.pin-wrap { min-height: 0; flex: 1; }
#app > .cifoot { margin-top: auto; }
@media (max-width: 900px) {
  .cifoot { flex-wrap: wrap; }
}
