/* Teilnahme (Mobil) – leicht, grosse Tippflächen, ruhige Typografie */

body.vote {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  display: flex;
  flex-direction: column;
}

.v-head {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 20px 12px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.v-head .brand { font-size: 14px; }
.v-head .brand img { width: 28px; }
.v-head .who { font-size: 12px; color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50%; }

.v-timer { position: sticky; top: 0; height: 4px; background: var(--paper-3); z-index: 11; }
.v-timer i { display: block; height: 100%; background: var(--green); transform-origin: left; }
.v-timer.warn i { background: var(--gold); }

.v-wrap {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 20px calc(120px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
}

.v-screen { animation: vIn .4s var(--ease) both; }
@keyframes vIn { from { opacity: 0; transform: translateY(8px); } }

.v-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.v-meta .eyebrow { color: var(--green); }
.v-clock { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.v-clock.warn { color: var(--gold); }

.v-q { font-size: clamp(23px, 6.4vw, 30px); font-weight: 680; letter-spacing: -.028em; line-height: 1.14; margin-bottom: 8px; overflow-wrap: anywhere; }
.v-sub { font-size: 14px; color: var(--muted); margin-bottom: 24px; }

/* Auswahl */
.choices { display: grid; gap: 10px; }
.choice {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 60px; padding: 14px 16px; text-align: left;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 0;
  font-size: 16.5px; font-weight: 520; letter-spacing: -.01em; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.choice b {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px;
  border: 1px solid var(--line-2); font-size: 13px; font-weight: 650; color: var(--ink-2);
  transition: background .15s, color .15s, border-color .15s;
}
.choice span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.choice:active { background: var(--paper-2); }
.choice.on { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); background: var(--green-soft); }
.choice.on b { background: var(--green); border-color: var(--green); color: #fff; }
.choice:focus-visible { outline: none; box-shadow: var(--focus); }
.choice.multi b { border-radius: 0; }
.choice:disabled { cursor: default; }

.yn { grid-template-columns: 1fr 1fr; }
.yn .choice { justify-content: center; min-height: 92px; font-size: 21px; font-weight: 650; }
.yn .choice.abstain { grid-column: 1 / -1; min-height: 56px; font-size: 16px; font-weight: 560; color: var(--ink-2); }
.yn .choice.on[data-v="1"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--paper-3); }
.yn .choice.on[data-v="2"] { border-color: var(--muted); box-shadow: inset 0 0 0 1px var(--muted); background: var(--paper-2); }

/* Skala */
.scale { display: grid; grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); gap: 8px; }
.scale .choice { justify-content: center; min-height: 58px; padding: 0; font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.scale-ends { display: flex; justify-content: space-between; gap: 16px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.scale-ends span:last-child { text-align: right; }

/* Rangfolge */
.rank { display: grid; gap: 8px; }
.rank-item {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px;
  min-height: 60px; padding: 8px 8px 8px 14px; background: var(--paper); border: 1px solid var(--line-2);
  transition: transform .25s var(--ease), background .2s;
}
.rank-item .pos { font-size: 20px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.rank-item:not(:first-child) .pos { color: var(--faint); }
.rank-item .lbl { font-size: 16px; font-weight: 520; overflow-wrap: anywhere; }
.rank-item .mv { display: flex; gap: 4px; }
.rank-item .mv button {
  display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line-2);
  background: var(--paper); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.rank-item .mv button:active { background: var(--paper-3); }
.rank-item .mv button:disabled { opacity: .25; }
.rank-item .mv svg { width: 18px; height: 18px; }
.rank-item.moved { background: var(--green-soft); }

/* Text / Zahl */
.v-input {
  width: 100%; min-height: 60px; padding: 14px 16px; font-size: 19px; font-weight: 520;
  border: 1px solid var(--line-2); border-radius: 0; background: var(--paper); appearance: none;
}
.v-input:focus { outline: none; border-color: var(--green); box-shadow: var(--focus); }
.v-input-row { display: flex; align-items: center; gap: 12px; }
.v-input-row .unit { font-size: 17px; font-weight: 600; color: var(--muted); }
.v-count { margin-top: 8px; font-size: 12.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* Absenden */
.v-submit {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--paper) 70%, transparent);
}
.v-submit .btn { width: 100%; max-width: 520px; margin: 0 auto; display: flex; min-height: 58px; font-size: 17px; }
.v-error { margin-top: 14px; padding: 12px 14px; background: var(--danger-soft); color: var(--danger); font-size: 14px; }

/* Zustände */
.v-state { margin: auto 0; padding: 20px 0 40px; }
.v-state .mark {
  display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 28px;
  background: var(--green); color: #fff;
}
.v-state .mark svg { width: 30px; height: 30px; }
.v-state .mark.wait { background: transparent; border: 1px solid var(--line-2); color: var(--green); }
.v-state .mark.gold { background: var(--gold); }
.v-state h1 { font-size: clamp(27px, 7.5vw, 36px); font-weight: 700; letter-spacing: -.035em; line-height: 1.08; margin-bottom: 12px; }
.v-state p { font-size: 16px; color: var(--muted); max-width: 34ch; }
.v-state .mine { margin-top: 24px; padding: 14px 16px; border-left: 3px solid var(--green); background: var(--paper-2); }
.v-state .mine small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.v-state .mine strong { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.v-state .btn { margin-top: 24px; }

.pulse { display: inline-flex; gap: 6px; }
.pulse i { width: 8px; height: 8px; background: var(--green); animation: pulse 1.2s infinite ease-in-out; }
.pulse i:nth-child(2) { animation-delay: .15s; }
.pulse i:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 80%, 100% { opacity: .2; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

.v-results { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--ink); }
.v-results .eyebrow { margin-bottom: 16px; display: block; }
.v-results .res { --rs: 15px; }

/* Beitritt */
.join { margin: auto 0; padding-bottom: 40px; }
.join h1 { font-size: clamp(40px, 13vw, 64px); font-weight: 750; letter-spacing: -.05em; line-height: .95; margin-bottom: 14px; }
.join h1 em { font-style: normal; color: var(--green); }
.join > p { font-size: 16px; color: var(--muted); margin-bottom: 32px; max-width: 32ch; }
.join form { display: grid; gap: 14px; }
.code-input {
  width: 100%; height: 76px; padding: 0 16px; text-align: center;
  font-size: 38px; font-weight: 700; letter-spacing: .18em; font-variant-numeric: tabular-nums;
  border: 1px solid var(--ink); border-radius: 0; background: var(--paper);
}
.code-input::placeholder { color: var(--line-2); }
.code-input:focus { outline: none; box-shadow: var(--focus); border-color: var(--green); }
.join .btn { min-height: 58px; font-size: 17px; }
.join .field + .field { margin-top: 2px; }
.join .input { min-height: 54px; font-size: 17px; }
.join-title { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--green); margin-bottom: 10px; }
.join-poll { font-size: clamp(26px, 7vw, 34px); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin-bottom: 10px; }

.v-foot { padding: 20px; text-align: center; font-size: 12px; color: var(--faint); }
.v-foot a { color: inherit; text-decoration: none; }

/* Startseite mit Bild (wie die Anmeldung) – zentriert */
body.join-page {
  position: relative;
  background: #0c100e url('/img/server.webp') center / cover no-repeat fixed;
  color: #fff;
}
body.join-page::before {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(8, 12, 10, .78) 0%, rgba(8, 12, 10, .62) 55%, rgba(8, 12, 10, .5) 100%);
}
body.join-page > * { position: relative; }
.join-page .v-head { justify-content: center; padding-top: calc(16px + env(safe-area-inset-top, 0px)); padding-bottom: 16px; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom-color: rgba(255, 255, 255, .14); }
.join-page .v-wrap { max-width: none; align-items: center; padding-bottom: 40px; }
.join-page .join { width: 100%; max-width: 460px; text-align: center; }
.join-page .join h1 em { color: #f3cf62; }
.join-page .join > p { color: rgba(255, 255, 255, .8); margin-left: auto; margin-right: auto; }
.join-page .join-card { padding: 24px; background: var(--paper); color: var(--ink); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); text-align: left; }
.join-page .v-foot { display: grid; justify-items: center; gap: 6px; }
.join-page .v-foot a { color: rgba(255, 255, 255, .55); }
.join-page .v-foot a:hover { color: #fff; }
.join-page .v-foot a.byline { font-size: 11px; letter-spacing: .04em; color: #fff; opacity: .85; }
.join-page .v-foot a.byline:hover { opacity: 1; text-decoration: underline; }

@media (max-width: 760px) {
  body.join-page { background-position: 70% center; background-attachment: scroll; }
  body.join-page::before { background: rgba(8, 12, 10, .74); }
}

/* PIN: sechs Kästchen, darunter ein echtes Eingabefeld (Einfügen, Autofill) */
.pin { position: relative; display: block; cursor: text; }
.pin-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0; font-size: 16px; color: transparent; caret-color: transparent;
}
.pin-cells { display: grid; grid-template-columns: repeat(3, 1fr) 14px repeat(3, 1fr); gap: 8px; pointer-events: none; }
.pin-cells b { align-self: center; height: 2px; background: var(--line-2); }
.pin-cells i {
  position: relative; display: grid; place-items: center;
  height: clamp(58px, 16vw, 72px);
  border: 1px solid var(--line-2); background: var(--paper);
  font-style: normal; font-size: clamp(28px, 8vw, 36px); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.pin-cells i.filled { border-color: var(--ink); }
.pin-cells i.active { border-color: var(--green); box-shadow: var(--focus); }
.pin-cells i.active:empty::after { content: ''; width: 2px; height: 42%; background: var(--green); animation: blink 1s steps(1) infinite; }
.pin.bad .pin-cells i { border-color: var(--danger); }
.pin.bad .pin-cells { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
