/* Wichteln (A.15.0.0): Namenskärtchen zum Antippen, Zettel mit Geschenkanhänger. */

.buehne-wichteln {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 22px;
}
.wi-titel { margin: 0; font-size: clamp(1.5rem, 5.4vw, 2.2rem); font-weight: 750; letter-spacing: -.02em; text-align: center; text-wrap: balance; }
.wi-info { margin: -8px 0 0; font-weight: 600; color: var(--tusche-weich); text-align: center; }
.wi-info:empty { display: none; }
.wi-alt { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; padding: 8px 8px 8px 16px; border-radius: 18px; background: #fef3c7; color: #78350f; font-weight: 600; }
.wi-alt[hidden] { display: none; }
.wi-leer { display: grid; justify-items: center; gap: 12px; max-width: 26em; text-align: center; color: var(--tusche-weich); font-weight: 550; }
.wi-leer[hidden] { display: none; }
.wi-leer p { margin: 0; }

.wi-personen {
  list-style: none;
  margin: 0;
  padding: 0;
  width: min(100%, 860px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
  gap: 10px;
}
.wi-personen:empty { display: none; }
.wi-person {
  position: relative;
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 64px;
  padding: 10px 14px 10px 50px;
  border: 0;
  border-radius: 18px;
  background: var(--flaeche);
  -webkit-backdrop-filter: var(--glas-blur);
  backdrop-filter: var(--glas-blur);
  box-shadow: var(--schatten-klein);
  color: var(--tusche);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: translate .15s ease, box-shadow .15s ease;
}
/* Geschenk links: rot mit goldener Schleife; nach dem Nachsehen ein Haken */
.wi-person::before {
  content: "";
  position: absolute;
  left: 12px;
  top: calc(50% - 14px);
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background:
    linear-gradient(90deg, transparent 11px, #fbbf24 11px 17px, transparent 17px),
    linear-gradient(transparent 9px, #fbbf24 9px 14px, transparent 14px),
    linear-gradient(135deg, #ef4444, #be123c);
}
.wi-person.gesehen::before { background: linear-gradient(135deg, #34d399, #059669); }
.wi-person.gesehen::after { content: "✓"; position: absolute; left: 20px; top: 50%; translate: 0 -50%; color: #fff; font-weight: 800; }
.wi-person:disabled { cursor: default; }
.wi-person:disabled::before { filter: grayscale(.6); opacity: .55; }
.wi-person:not(:disabled):hover { translate: 0 -2px; box-shadow: var(--schatten-gross); }
.wi-person:focus-visible { outline: 2px solid var(--akzent); outline-offset: 3px; }
.wi-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 1.1rem; }
.wi-person small { color: var(--tusche-weich); font-weight: 550; }
.wi-person small:empty { display: none; }
.wi-person.gesehen small { color: #047857; }
.wi-personen.neu li { animation: wi-auf .5s cubic-bezier(.2, 1.4, .4, 1) backwards; }
.wi-personen.neu li:nth-child(2n) { animation-delay: .06s; }
.wi-personen.neu li:nth-child(3n) { animation-delay: .12s; }
@keyframes wi-auf { from { scale: .7; opacity: 0; } }

.wi-knoepfe { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.los-knopf { min-width: min(80vw, 300px); min-height: 60px; font-size: 1.3rem; font-weight: 650; letter-spacing: -.01em; }
.wi-hinweis { margin: 0; max-width: 34em; font-weight: 550; color: var(--tusche-weich); text-align: center; text-wrap: balance; }

/* Zettel */
.wi-zettel { text-align: center; }
.wi-zettel .dialog-knoepfe { justify-content: center; }
.wi-zettel .wi-runde { margin: 0 0 4px !important; font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--tusche-weich); }
.wi-zettel .wi-du { margin: 0 0 14px !important; font-size: 1.15rem; font-weight: 600; }
.wi-anhaenger {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 0 auto 14px;
  width: min(100%, 300px);
  padding: 22px 18px 20px;
  border-radius: 18px 18px 18px 18px;
  background: linear-gradient(135deg, #ef4444, #be123c);
  color: #fff;
  box-shadow: 0 14px 30px rgba(190, 18, 60, .35);
  animation: wi-anhaenger .6s cubic-bezier(.2, 1.5, .4, 1);
}
.wi-schleife { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #fbbf24; color: #78350f; }
.wi-schleife svg { width: 26px; height: 26px; }
.wi-anhaenger b { font-family: var(--schrift-titel); font-size: clamp(1.8rem, 8vw, 2.6rem); line-height: 1.1; overflow-wrap: anywhere; }
.wi-zettel .wi-extra { margin: 0 0 6px !important; font-weight: 600; }
.wi-zettel .wi-extra:empty { display: none; }
.wi-zettel .wi-tipp { margin: 0 0 16px !important; color: var(--tusche-weich); font-size: .92rem; }
@keyframes wi-anhaenger { from { rotate: -14deg; scale: .4; opacity: 0; } }

/* Regeln (wie bei Teams) */
.regel-liste { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.regel-liste:empty { display: none; }
.regel-liste li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border-radius: 14px; background: var(--flaeche); box-shadow: var(--schatten-klein); font-weight: 650; }
.regel-liste li.weg { opacity: .55; }
.regel-neu { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; align-items: center; margin-bottom: 6px; }
.regel-neu[hidden] { display: none; }
.regel-neu > span { font-weight: 750; color: var(--tusche-weich); }
.regel-neu select { min-height: 44px; min-width: 0; padding: 0 8px; border: 1px solid rgba(139, 92, 246, .22); border-radius: 12px; background: rgba(255, 255, 255, .75); font: inherit; font-weight: 600; color: var(--tusche); }
.regel-neu .knopf { grid-column: 1 / -1; justify-self: start; }

.wi-feld { display: grid; gap: 4px; margin-bottom: 10px; font-weight: 600; color: var(--tusche-weich); }
.wi-feld input { min-height: 44px; padding: 0 12px; border: 1px solid rgba(139, 92, 246, .22); border-radius: 12px; background: rgba(255, 255, 255, .75); font: inherit; font-weight: 600; color: var(--tusche); }
.wi-feld input:focus { outline: 2px solid var(--akzent); outline-offset: 1px; background: #fff; }

@media (min-width: 980px) {
  .buehne-wichteln { min-height: calc(100dvh - 140px); justify-content: center; }
}
@media (orientation: landscape) and (max-height: 540px) and (min-width: 480px) {
  .buehne-wichteln { gap: 10px; padding-top: 0; }
  .wi-personen { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .wi-person { min-height: 52px; }
  .los-knopf { min-height: 50px; font-size: 1.15rem; }
}
