:root {
  --bg: #2a0812;
  --paper: #4a1020;
  --paper-2: #5c1630;
  --line: #8b2f45;
  --cream: #fff4d6;
  --cream-dim: #f0c9a0;
  --gold: #ffb703;
  --gold-deep: #fb8500;
  --tomato: #e63946;
  --foam: #fff8e7;
  --ok: #b5e48c;
  --err: #ffc2c7;
  --focus: #ffd166;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
  --radius: 28px;
  --font: "Nunito", "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: var(--font);
  font-size: 1.06rem;
  line-height: 1.5;
  color: var(--cream);
  background:
    radial-gradient(ellipse 90% 55% at 50% -15%, rgba(255, 183, 3, 0.28), transparent 52%),
    radial-gradient(circle at 0% 80%, rgba(230, 57, 70, 0.28), transparent 42%),
    radial-gradient(circle at 110% 30%, rgba(251, 133, 0, 0.2), transparent 38%),
    var(--bg);
}

.sky {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.floater {
  position: absolute;
  font-size: 2rem;
  opacity: 0.22;
  animation: drift 14s ease-in-out infinite;
}

.f1 { top: 8%; left: 6%; animation-duration: 16s; }
.f2 { top: 18%; right: 8%; font-size: 2.4rem; animation-delay: -3s; }
.f3 { bottom: 22%; left: 10%; animation-delay: -6s; font-size: 1.6rem; }
.f4 { top: 58%; right: 6%; animation-delay: -2s; }
.f5 { bottom: 8%; right: 18%; animation-delay: -8s; font-size: 2.2rem; }
.f6 { top: 40%; left: 4%; animation-delay: -5s; font-size: 1.5rem; }

@keyframes drift {
  0%,
  100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-18px) rotate(10deg); }
}

.confetti {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 6;
  overflow: hidden;
}

.confetti-bit {
  position: absolute;
  top: 42%;
  left: 50%;
  font-size: 1.6rem;
  animation: pop-fly 1.7s ease-out forwards;
}

@keyframes pop-fly {
  0% {
    opacity: 1;
    transform: translate(-50%, 0) scale(0.4) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(1.15) rotate(var(--rot));
  }
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 8;
  padding: 0.6rem 0.9rem;
  background: var(--gold);
  color: #2a0812;
  font-weight: 800;
  text-decoration: none;
  border-radius: 8px;
}

.skip:focus {
  top: 0.75rem;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(38rem, 100%);
  margin: 0 auto;
  padding: 1.15rem 0.9rem 3rem;
  padding-top: max(1.15rem, env(safe-area-inset-top));
  padding-bottom: max(3rem, env(safe-area-inset-bottom));
}

.card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 248, 231, 0.08), transparent 30%),
    var(--paper);
  border: 3px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 0 0 6px rgba(75, 16, 32, 0.5);
  padding: 1.7rem 1.2rem 1.45rem;
}

.gate {
  overflow: hidden;
}

.gate.shake {
  animation: shake 0.45s ease;
}

@keyframes shake {
  0%,
  100% { transform: translateX(0); }
  20% { transform: translateX(-10px) rotate(-1deg); }
  40% { transform: translateX(10px) rotate(1deg); }
  60% { transform: translateX(-7px); }
  80% { transform: translateX(7px); }
}

.stamp {
  width: 4.2rem;
  height: 4.2rem;
  margin: 0 auto 0.65rem;
  display: grid;
  place-items: center;
  border: 3px solid var(--tomato);
  border-radius: 50%;
  color: var(--tomato);
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  transform: rotate(-12deg);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.15);
}

.party {
  animation: reveal 0.55s ease;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.masthead {
  position: relative;
  text-align: center;
  padding-bottom: 0.35rem;
}

.kicker {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.heroes {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  margin: 0.15rem 0 0.55rem;
  font-size: 3rem;
  line-height: 1;
  filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.18));
}

.hero-pizza {
  animation: wiggle 2.8s ease-in-out infinite;
}

.hero-beer {
  animation: wiggle 2.8s ease-in-out infinite;
  animation-delay: -1.2s;
}

.unlocked-heroes .hero-pizza,
.unlocked-heroes .hero-beer {
  animation-duration: 1.4s;
}

@keyframes wiggle {
  0%,
  100% { transform: rotate(-8deg) translateY(0); }
  50% { transform: rotate(10deg) translateY(-6px); }
}

h1 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-size: clamp(1.85rem, 8.4vw, 2.55rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
  overflow-wrap: break-word;
}

.promise,
.lead {
  margin: 0 auto 0.5rem;
  max-width: 30ch;
  color: var(--cream-dim);
}

.promise {
  color: var(--cream);
  font-weight: 800;
  font-size: 1.12rem;
  max-width: 28ch;
}

.lead {
  font-size: 1rem;
}

.block,
.sub {
  border: 0;
  margin: 1.4rem 0 0;
  padding: 0;
}

.block > legend,
.sub > legend {
  padding: 0;
  margin-bottom: 0.7rem;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--gold);
}

.field {
  margin-bottom: 0.95rem;
}

.field.nested {
  margin-top: 0.75rem;
}

label,
.sub > legend {
  display: block;
}

.field > label {
  margin-bottom: 0.35rem;
  font-weight: 800;
  font-size: 0.95rem;
}

input[type="text"],
input[type="tel"],
input[type="password"],
input[type="date"],
textarea {
  width: 100%;
  min-height: 3.1rem;
  padding: 0.7rem 0.85rem;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #2a0812;
  color: var(--cream);
  font: inherit;
  font-size: 16px;
}

textarea {
  min-height: 4.6rem;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #c9897a;
}

input:focus,
textarea:focus,
button:focus-visible,
.chip:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.hint {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
  color: var(--cream-dim);
}

.code-row {
  display: flex;
  gap: 0.5rem;
}

.code-row input {
  flex: 1;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
}

.ghost {
  min-width: 4.6rem;
  min-height: 3.1rem;
  padding: 0 0.8rem;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--paper-2);
  color: var(--cream);
  font: inherit;
  font-weight: 800;
  font-size: 0.9rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  position: relative;
  display: inline-flex;
  min-height: 2.9rem;
  margin: 0;
  cursor: pointer;
}

.chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.chip span {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.95rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #2a0812;
  color: var(--cream);
  font-weight: 800;
  font-size: 0.95rem;
}

.chip input:checked + span {
  border-color: var(--gold);
  background: var(--gold);
  color: #2a0812;
}

.split {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 540px) {
  .card {
    padding: 2.15rem 2rem 1.9rem;
  }

  .split {
    grid-template-columns: 1fr 1fr;
  }

}

.check {
  margin: 1.35rem 0 1.1rem;
}

.check-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.85rem 0.9rem;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #2a0812;
  cursor: pointer;
}

.check-label input {
  width: 1.4rem;
  height: 1.4rem;
  margin-top: 0.15rem;
  accent-color: var(--gold);
  flex: none;
}

.check-label small {
  display: block;
  margin-top: 0.15rem;
  color: var(--cream-dim);
  font-size: 0.88rem;
  font-weight: 600;
}

.submit {
  width: 100%;
  min-height: 3.4rem;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffd166, var(--gold-deep));
  color: #2a0812;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  cursor: pointer;
  box-shadow: 0 8px 0 #9a4a00;
  transform: translateY(0);
}

.submit:hover {
  filter: brightness(1.05);
}

.submit:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #9a4a00;
}

.submit:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.banner {
  margin: 0.35rem 0 1rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
}

.banner h2 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: 1.85rem;
  letter-spacing: -0.03em;
}

.banner p {
  margin: 0;
  color: var(--cream);
  font-weight: 700;
}

.banner-ok {
  border: 2px solid rgba(181, 228, 140, 0.55);
  background: rgba(64, 120, 40, 0.35);
  text-align: center;
}

.pop {
  margin: 0 0 0.35rem;
  font-size: 2rem;
}

.banner-err {
  border: 2px solid rgba(255, 194, 199, 0.55);
  background: rgba(140, 28, 40, 0.45);
  color: var(--err);
  font-weight: 800;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .floater,
  .confetti {
    display: none;
  }
}
