:root {
  --pu-gw-green: #004128;
  --pu-gw-gold: #a39161;
  --pu-gw-background: #d9cfc0;
}

html.pu-giveaway-locked,
html.pu-giveaway-locked body {
  overflow: hidden !important;
}

.pu-giveaway-open,
.pu-giveaway-submit {
  appearance: none;
  border: 0;
  border-radius: 0;
  background: var(--pu-gw-green);
  color: #fff;
  cursor: pointer;
  font-family: "brandon-grotesque", Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .015em;
  min-width: 166px;
  padding: 15px 24px 14px;
  text-transform: uppercase;
  transition: background-color .2s ease, color .2s ease;
}

.pu-giveaway-open:hover,
.pu-giveaway-open:focus-visible,
.pu-giveaway-submit:hover,
.pu-giveaway-submit:focus-visible {
  background: var(--pu-gw-gold);
  color: #fff;
}

.pu-giveaway-submit:disabled {
  cursor: wait;
  opacity: .65;
}

.pu-giveaway-modal[hidden],
.pu-giveaway-confetti[hidden],
.pu-giveaway-state[hidden],
.pu-giveaway-prize-image[hidden] {
  display: none !important;
}

.pu-giveaway-modal {
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
  font-family: "brandon-grotesque", Arial, sans-serif;
}

/* Kein eigenes Hintergrundmotiv: Diese Ebene zeichnet ausschließlich die
   tatsächlich geöffnete Website hinter dem Modal weich. */
.pu-giveaway-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(0, 20, 14, .08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.pu-giveaway-dialog {
  position: relative;
  z-index: 2;
  width: min(408px, calc(100vw - 30px));
  box-sizing: border-box;
  padding: 54px 44px 42px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--pu-gw-background);
  color: var(--pu-gw-green);
  text-align: center;
  box-shadow: none;
  flex: 0 0 auto;
  margin: auto 0;
  animation: puGiveawayPop .24s ease-out both;
}

.pu-giveaway-dialog::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1.5px solid var(--pu-gw-green);
  border-radius: 11px;
  pointer-events: none;
}

.pu-giveaway-close {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.pu-giveaway-state {
  position: relative;
  z-index: 1;
}

.pu-giveaway-code-title {
  margin: 0;
  color: var(--pu-gw-green);
  font-family: "brandon-grotesque", Arial, sans-serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.pu-code-inputs {
  display: grid;
  grid-template-columns: repeat(6, 44px);
  justify-content: center;
  gap: 8px;
  margin: 52px auto 52px;
}

.pu-code-inputs input {
  width: 44px;
  height: 44px;
  box-sizing: border-box;
  border: 1.5px solid var(--pu-gw-green);
  border-radius: 0;
  background: #fff;
  color: var(--pu-gw-green);
  font-family: "brandon-grotesque", Arial, sans-serif;
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  outline: none;
}

.pu-code-inputs input:focus {
  border-color: var(--pu-gw-gold);
  box-shadow: 0 0 0 1px var(--pu-gw-gold);
}

.pu-giveaway-message {
  min-height: 0;
  margin: 14px auto 0;
  max-width: 285px;
  color: var(--pu-gw-green);
  font-family: "brandon-grotesque", Arial, sans-serif;
  font-size: 12px !important;
  font-weight: 400;
  line-height: 1.25;
}

.pu-giveaway-message:empty {
  margin-top: 0;
}

/* Gewinnzustand nach Layoutvorgabe. */
.pu-giveaway-win {
  padding: 2px 0 0;
}

.pu-giveaway-kicker {
  margin: 0 0 10px;
  color: var(--pu-gw-green);
  font-family: "brandon-grotesque", Arial, sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: .95;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.pu-giveaway-win-title {
  margin: 0 auto;
  max-width: 310px;
  color: var(--pu-gw-green);
  font-family: "brandon-grotesque", Arial, sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.pu-giveaway-prize-image {
  height: 218px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px auto 8px;
}

.pu-giveaway-prize-image img {
  display: block;
  max-width: 230px;
  max-height: 210px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.pu-giveaway-dialog[data-prize-key="tshirt"] .pu-giveaway-prize-image img {
  max-width: 205px;
  max-height: 215px;
}

.pu-giveaway-dialog[data-prize-key="cap"] .pu-giveaway-prize-image img,
.pu-giveaway-dialog[data-prize-key="glas"] .pu-giveaway-prize-image img {
  max-width: 245px;
  max-height: 190px;
}

.pu-giveaway-dialog[data-prize-key="gutschein"] .pu-giveaway-prize-image {
  height: 246px;
  margin-top: 7px;
  margin-bottom: 3px;
}

.pu-giveaway-dialog[data-prize-key="gutschein"] .pu-giveaway-prize-image img {
  max-width: 166px;
  max-height: 244px;
}

.pu-giveaway-dialog[data-prize-key="reise"] .pu-giveaway-prize-image img {
  max-width: 270px;
  max-height: 190px;
}

.pu-giveaway-register-copy {
  margin: 5px auto 16px;
  color: var(--pu-gw-green);
  font-family: "brandon-grotesque", Arial, sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.08;
}

.pu-giveaway-register {
  min-width: 166px;
}

/* Bewegtes, rein goldenes Konfetti. Die Partikel werden per JavaScript
   erzeugt. So gibt es keine weißen Rasterflächen mehr und der Regen bleibt
   auf Desktop und Mobile sauber skalierbar. */
.pu-giveaway-confetti {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.pu-confetti-piece {
  position: absolute;
  top: -14vh;
  left: var(--left, 50%);
  width: var(--w, 12px);
  height: var(--h, 28px);
  opacity: var(--opacity, 1);
  border-radius: 2px;
  background: linear-gradient(135deg, #8a4700 0%, #c96f00 18%, #f0a91b 42%, #ffe27a 60%, #d37c00 82%, #7b3900 100%);
  box-shadow: inset 1px 0 0 rgba(255,255,255,.35), inset -1px 0 0 rgba(67,31,0,.18);
  transform-origin: 50% 50%;
  animation: puConfettiFall var(--duration, 5.8s) linear var(--delay, 0s) infinite;
  will-change: transform;
}

.pu-confetti-piece.is-ribbon {
  border-radius: 2px 9px 2px 9px;
  clip-path: polygon(0 0, 100% 9%, 78% 48%, 100% 100%, 0 91%, 22% 52%);
}

.pu-confetti-piece.is-small {
  border-radius: 1px 5px 1px 5px;
}

@keyframes puGiveawayPop {
  from { opacity: 0; transform: scale(.97); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes puConfettiFall {
  0% {
    transform: translate3d(0, -10vh, 0) rotate(0deg) rotateY(0deg);
  }
  28% {
    transform: translate3d(var(--drift-mid, 0px), 28vh, 0) rotate(var(--spin-mid, 150deg)) rotateY(180deg);
  }
  62% {
    transform: translate3d(var(--drift-back, 0px), 67vh, 0) rotate(var(--spin-late, 330deg)) rotateY(420deg);
  }
  100% {
    transform: translate3d(var(--drift, 0px), 122vh, 0) rotate(var(--spin, 540deg)) rotateY(720deg);
  }
}

@media (max-width: 520px) {
  .pu-giveaway-modal {
    padding: 15px;
  }

  .pu-giveaway-dialog {
    width: min(408px, calc(100vw - 30px));
    padding: 50px 22px 38px;
  }

  .pu-giveaway-code-title {
    font-size: 17px;
  }

  .pu-code-inputs {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    width: min(310px, 100%);
    margin: 48px auto 48px;
  }

  .pu-code-inputs input {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    min-width: 0;
    font-size: clamp(19px, 6vw, 25px);
  }

  .pu-giveaway-kicker {
    font-size: 20px;
  }

  .pu-giveaway-win-title {
    font-size: 15px;
  }

  .pu-giveaway-prize-image {
    height: 200px;
  }

  .pu-giveaway-register-copy {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pu-giveaway-dialog {
    animation: none;
  }

  .pu-confetti-piece {
    animation: none;
    display: none;
  }
}

/* WPForms-Registrierung – bewusst neutral gehalten, bis das finale
   Registrierungs-Layout vorliegt. Die bestehenden Code-/Gewinnzustände
   bleiben davon unberührt. */
.pu-giveaway-dialog[data-view="register"],
.pu-giveaway-dialog[data-view="complete"] {
  width: min(560px, calc(100vw - 30px));
  max-height: none;
  overflow: visible;
  padding: 42px 48px 38px;
}

.pu-giveaway-registration-form .wpforms-container {
  margin: 0 !important;
  text-align: left;
  font-family: "brandon-grotesque", Arial, sans-serif !important;
}

.pu-giveaway-registration-form .wpforms-container .wpforms-field {
  padding: 7px 0 !important;
}

.pu-giveaway-registration-form .wpforms-container label,
.pu-giveaway-registration-form .wpforms-container .wpforms-field-label,
.pu-giveaway-registration-form .wpforms-container .wpforms-field-sublabel {
  color: var(--pu-gw-green) !important;
  font-family: "brandon-grotesque", Arial, sans-serif !important;
}

.pu-giveaway-registration-form .wpforms-container .wpforms-field-label {
  font-weight: 700 !important;
}

.pu-giveaway-registration-form .wpforms-container input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.pu-giveaway-registration-form .wpforms-container select,
.pu-giveaway-registration-form .wpforms-container textarea {
  border: 1.5px solid var(--pu-gw-green) !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: var(--pu-gw-green) !important;
  font-family: "brandon-grotesque", Arial, sans-serif !important;
  box-shadow: none !important;
}

.pu-giveaway-registration-form .wpforms-container input:focus,
.pu-giveaway-registration-form .wpforms-container select:focus,
.pu-giveaway-registration-form .wpforms-container textarea:focus {
  border-color: var(--pu-gw-gold) !important;
  box-shadow: 0 0 0 1px var(--pu-gw-gold) !important;
}

.pu-giveaway-registration-form .wpforms-container button[type="submit"],
.pu-giveaway-registration-form .wpforms-container input[type="submit"] {
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--pu-gw-green) !important;
  color: #fff !important;
  font-family: "brandon-grotesque", Arial, sans-serif !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: .015em !important;
  padding: 15px 24px 14px !important;
  text-transform: uppercase !important;
}

.pu-giveaway-registration-form .wpforms-container button[type="submit"]:hover,
.pu-giveaway-registration-form .wpforms-container button[type="submit"]:focus-visible,
.pu-giveaway-registration-form .wpforms-container input[type="submit"]:hover,
.pu-giveaway-registration-form .wpforms-container input[type="submit"]:focus-visible {
  background: var(--pu-gw-gold) !important;
}

.pu-giveaway-registration-form .wpforms-container .wpforms-error,
.pu-giveaway-registration-form .wpforms-container label.wpforms-error {
  color: #7a1d16 !important;
}

/* WPForms-Erfolgsbestätigung im PU-Look statt des standardmäßigen
   hellgrünen WPForms-Success-Hinweises. */
.pu-giveaway-registration-form .wpforms-confirmation-container-full,
.pu-giveaway-registration-form .wpforms-confirmation-container,
.pu-giveaway-registration-form div[submit-success] > .wpforms-confirmation-container-full {
  margin: 0 !important;
  padding: 12px 0 4px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--pu-gw-green) !important;
  box-shadow: none !important;
  font-family: "brandon-grotesque", Arial, sans-serif !important;
  text-align: center !important;
}

.pu-giveaway-registration-form .wpforms-confirmation-container-full p,
.pu-giveaway-registration-form .wpforms-confirmation-container p {
  color: var(--pu-gw-green) !important;
  font-family: "brandon-grotesque", Arial, sans-serif !important;
}

.pu-giveaway-field-hidden {
  display: none !important;
}

.pu-giveaway-admin-hint {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--pu-gw-green);
  color: var(--pu-gw-green);
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
}

@media (max-width: 520px) {
  .pu-giveaway-dialog[data-view="register"],
  .pu-giveaway-dialog[data-view="complete"] {
    width: calc(100vw - 30px);
    max-height: none;
    overflow: visible;
    padding: 36px 24px 30px;
  }
}


/* v0.4.0-rc3: Registrierung scrollt über das Modal statt innerhalb des
   Dialogs. Dadurch wächst der Dialog inklusive Innenrahmen mit dem gesamten
   WPForms-Inhalt; auf kleinen Displays bleiben E-Mail-Feld, Checkbox und
   Submit erreichbar, ohne dass Inhalte optisch aus dem Rahmen rutschen. */

/* Live stock visibility in WPForms Modern (Choices.js) dropdown. */
.pu-giveaway-modal .choices__list--dropdown .choices__item.pu-shirt-choice-soldout,
.pu-giveaway-modal .choices__list[aria-expanded] .choices__item.pu-shirt-choice-soldout { display: none !important; }
.pu-giveaway-modal .pu-shirt-size-hint { margin: 5px 0 0; font-size: 12px; line-height: 1.4; }
