/* ==========================================================================
   BetaBe Events - Abstimmungen (Startseite und /events)

   Karte: Jede Option setzt --a und --b (ihre zwei Farben). Angetippt zeigt die
   Karte eine kleine Vorschau (Farben + Effekt), erst "bestätigen" zählt.
   Die Motto-Looks der ganzen Seite stehen in css/motto.css.
   ========================================================================== */

/* --- Karte ------------------------------------------------------------------ */
.vote-section[hidden] { display: none; }
.vote-section { padding-block: clamp(2rem, 5vw, 3.5rem); }

.vote {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  max-width: 820px;
  margin-inline: auto;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-bg-alt);
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.vote.has-auswahl {
  border-color: color-mix(in srgb, var(--a) 60%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--a) 25%, transparent), 0 20px 60px color-mix(in srgb, var(--a) 18%, transparent);
}
.vote + .vote { margin-top: 1.25rem; }
.vote h2 { margin: 0.25rem 0 1.25rem; font-size: clamp(1.4rem, 4.5vw, 1.9rem); line-height: 1.2; }

/* Farbiger Schein in der Ecke, wechselt weich die Farbe */
.vote__glow {
  position: absolute;
  z-index: -2;
  top: -35%;
  right: -20%;
  width: 70%;
  height: 80%;
  border-radius: 50%;
  background-color: var(--a);
  filter: blur(80px);
  opacity: 0.3;
  transition: background-color 0.5s var(--ease), opacity 0.5s var(--ease);
  pointer-events: none;
}
.vote.has-auswahl .vote__glow { opacity: 0.45; }

.vote__options,
.vote__results { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.vote__options { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .vote__options { grid-template-columns: repeat(4, 1fr); } }

.vote__option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  height: 100%;
  padding: 0.9rem 0.6rem 1rem;
  text-align: center;
  cursor: pointer;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-strong);
  background: rgba(0, 0, 0, 0.45);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.vote__art {
  width: clamp(64px, 20vw, 88px);
  height: auto;
  aspect-ratio: 1;
  margin-bottom: 0.4rem;
  transition: transform 0.35s var(--ease);
}
.vote__icon--linie { color: var(--a); padding: 14%; }
.vote__option:hover,
.vote__option:focus-visible {
  border-color: var(--a);
  background: linear-gradient(160deg, color-mix(in srgb, var(--a) 18%, rgba(0, 0, 0, 0.45)), rgba(0, 0, 0, 0.45));
}
.vote__option:hover .vote__art { transform: translateY(-3px) rotate(-4deg) scale(1.04); }

.vote.has-auswahl .vote__option:not(.is-selected) { opacity: 0.45; }
.vote__option.is-selected {
  border-color: var(--a);
  background: linear-gradient(160deg, color-mix(in srgb, var(--a) 30%, rgba(0, 0, 0, 0.4)), color-mix(in srgb, var(--b) 12%, rgba(0, 0, 0, 0.5)));
  transform: translateY(-3px);
}
.vote__option.is-selected .vote__art { animation: voteSchweben 2.4s ease-in-out infinite; }
@keyframes voteSchweben {
  0%, 100% { transform: translateY(0) rotate(-3deg) scale(1.08); }
  50% { transform: translateY(-6px) rotate(3deg) scale(1.12); }
}

.vote__title { font-family: var(--font-head); font-weight: 600; font-size: 1rem; line-height: 1.2; }
.vote__text { font-size: 0.8rem; line-height: 1.35; color: var(--color-text-muted); }

/* Bestätigen-Leiste, erscheint nach dem Antippen */
.vote__confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1.1rem;
  animation: voteEinblenden 0.35s var(--ease);
}
.vote__confirm[hidden] { display: none; }
.vote__go {
  background: linear-gradient(135deg, var(--a), var(--b));
  color: #0a0a12;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--a) 35%, transparent);
}
.vote__go:hover { color: #0a0a12; }
.vote__preview-note { font-size: 0.82rem; color: var(--color-text-muted); }
@keyframes voteEinblenden { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Beendete Abstimmung: die Frage steht klein unter dem Sieger */
.vote__frage { margin: -0.4rem 0 1.25rem; color: var(--color-text-muted); }

/* Ergebnis */
.vote__result {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1rem 0.55rem 0.6rem;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: rgba(0, 0, 0, 0.45);
}
.vote__result.is-mine { border-color: var(--a); }
.vote__bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--a) 45%, transparent), color-mix(in srgb, var(--b) 25%, transparent));
  transition: width 0.6s var(--ease);
}
.vote__name,
.vote__pct { position: relative; font-weight: 600; }
.vote__name { display: flex; align-items: center; flex-wrap: wrap; gap: 0.15rem 0.6rem; }
.vote__mini { width: 40px; height: 40px; flex: none; }
.vote__mini.vote__icon--linie { padding: 8px; }
.vote__tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  color: #0a0a12;
  background: var(--a);
}
.vote__pct { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }

.vote__footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-top: 1rem; }
.vote__note,
.vote__hint { margin: 0; font-size: 0.85rem; color: var(--color-text-muted); }
.vote__hint { margin-top: 1rem; }
.vote__undo { font-size: 0.85rem; }
.vote__error { margin: 0.75rem 0 0; color: #fca5a5; font-size: 0.9rem; }
.vote__error[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .vote__glow, .vote__option, .vote__bar, .vote__art { transition: none; }
  .vote__option.is-selected .vote__art, .vote__confirm { animation: none; }
  .vote__option:hover .vote__art { transform: none; }
}
