/* Digitaler Wahlzettel – amtlicher Stimmzettel an der Kühlschranktür */

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.vote-page { max-width: 760px; margin-inline: auto; }

.vote-intro { text-align: center; margin-bottom: clamp(30px, 4.5vw, 48px); }
.vote-intro h1 { font-size: clamp(2.5rem, 6vw, 4.2rem); }
.vote-intro p { margin: 10px auto 0; max-width: 44ch; color: var(--ink-soft); font-size: 1.15rem; }

/* ---------- Der Stimmzettel ---------- */

.ballot {
    --ballot-ink: #15181d;
    --ballot-paper: #fbfaf6;
    position: relative;
    margin: 0 auto;
    padding: clamp(22px, 4vw, 40px) clamp(18px, 4vw, 44px) clamp(20px, 3vw, 30px);
    background:
        radial-gradient(circle at 18% 12%, rgba(255,255,255,.9), transparent 40%),
        var(--ballot-paper);
    color: var(--ballot-ink);
    border-radius: 2px;
    box-shadow: var(--shadow-lift);
    transform: rotate(-.5deg);
}
.ballot__magnet { --size: 34px; top: -14px; }
.ballot__magnet--l { left: 14%; }
.ballot__magnet--r { right: 14%; }

.ballot__head {
    text-align: center;
    padding-bottom: 18px;
    border-bottom: 3px solid var(--ballot-ink);
}
.ballot__kicker {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 7vw, 3.6rem);
    line-height: 1;
    letter-spacing: .02em;
}
.ballot__head h2 {
    font-family: var(--font-body);
    font-weight: 800;
    font-size: clamp(1.05rem, 2.6vw, 1.35rem);
    margin-top: 8px;
}
.ballot__district { margin: 4px 0 0; font-size: .95rem; color: #3e4652; }

.ballot__votes {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--ballot-ink);
    font-size: .95rem;
}
.ballot__count strong {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 10px;
    background: var(--ballot-ink);
    color: var(--ballot-paper);
    border-radius: 3px;
    font-size: 1.05rem;
}
.ballot__hint { text-align: right; color: #3e4652; line-height: 1.35; font-size: .88rem; }

.ballot__list { margin: 0; padding: 0; border: 0; min-width: 0; }

.ballot__row {
    display: grid;
    grid-template-columns: 52px 1fr 76px;
    align-items: stretch;
    min-height: 74px;
    border-bottom: 1px solid var(--ballot-ink);
}
.ballot__row:last-child { border-bottom-width: 3px; }

.ballot__num {
    display: grid;
    place-items: center;
    border-right: 1px solid var(--ballot-ink);
    font-weight: 800;
    font-size: 1.15rem;
}

.ballot__slot {
    display: flex;
    align-items: center;
    padding: 0 18px;
    border-right: 1px solid var(--ballot-ink);
    overflow: visible;
}
.ballot__party {
    display: inline-block;
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 5vw, 2.3rem);
    line-height: 1;
    letter-spacing: .03em;
    will-change: transform;
}
.ballot__party.is-flying { position: relative; z-index: 2; }

.ballot__circle {
    position: relative;
    display: grid;
    place-items: center;
    cursor: pointer;
}
.ballot__circle input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.ballot__circle svg { width: 46px; height: 46px; overflow: visible; pointer-events: none; }
.ballot__circle .ring { fill: #fff; stroke: var(--ballot-ink); stroke-width: 2.4; transition: stroke-width .15s, fill .15s; }
.ballot__circle .cross {
    fill: none;
    stroke: var(--cobalt-dark);
    stroke-width: 4.2;
    stroke-linecap: round;
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
}
.ballot__circle:hover .ring { stroke-width: 3.4; fill: #fffbe3; }
.ballot__circle input:focus-visible + .sr-only + svg .ring { stroke: var(--cobalt); stroke-width: 4; }
.ballot__circle input:checked + .sr-only + svg .cross { stroke-dashoffset: 0; transition: stroke-dashoffset .45s var(--ease-out); }

.ballot__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 18px;
    padding-top: 16px;
    font-size: .9rem;
    color: #3e4652;
}
.ballot__foot p { margin: 0; }
.ballot__small { font-size: .78rem; flex-basis: 100%; order: 2; }
.ballot__submit { order: 1; }
.has-js .ballot__submit { display: none; }

.ballot__dodges {
    position: absolute;
    right: clamp(14px, 3vw, 30px);
    bottom: -18px;
    margin: 0;
    padding: 6px 12px;
    background: var(--tape);
    color: var(--ink);
    font-size: .85rem;
    font-weight: 700;
    transform: rotate(2deg);
    box-shadow: 0 4px 10px -6px rgba(29,36,48,.5);
}

/* ---------- Ergebnis ---------- */

.vote-result { text-align: center; background: #fffbe9; }
.vote-result--static { margin-top: 44px; --tilt: .8deg; padding: clamp(28px, 5vw, 44px); }
.vote-dialog .note { --tilt: .6deg; }
.vote-result .magnet { --size: 30px; top: 12px; left: calc(50% - 15px); }
.vote-result__kicker { margin: 10px 0 6px !important; font-weight: 700; color: var(--ink-soft); }
.vote-result h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.vote-result h2 span { color: var(--cobalt-dark); white-space: nowrap; }
.vote-result__punch {
    margin: 18px auto 6px !important;
    max-width: 22ch;
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 4.6vw, 2.5rem);
    line-height: 1.1;
    color: var(--ink) !important;
    text-wrap: balance;
}
.vote-stamp {
    display: block;
    width: 150px;
    height: 150px;
    margin: 6px auto 18px;
    color: var(--tomato);
    font-family: var(--font-body);
    opacity: .82;
    transform: rotate(-12deg);
    mix-blend-mode: multiply;
}
.vote-result__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

@media (prefers-reduced-motion: no-preference) {
    .vote-dialog[open] .vote-stamp { animation: stamp .5s .35s cubic-bezier(.2, 1.6, .4, 1) both; }
}
@keyframes stamp {
    from { opacity: 0; transform: rotate(-12deg) scale(2.2); }
    to   { opacity: .82; transform: rotate(-12deg) scale(1); }
}

@media (max-width: 520px) {
    .ballot { transform: none; }
    .ballot__row { grid-template-columns: 40px 1fr 64px; min-height: 62px; }
    .ballot__slot { padding: 0 12px; }
    .ballot__votes { flex-direction: column; align-items: flex-start; gap: 6px; }
    .ballot__hint { text-align: left; }
    .ballot__circle svg { width: 40px; height: 40px; }
}
