:root {
  --bg: #061a20;
  --teal: #14b8a6;
  --gold: #f2c46d;
  --gold-deep: #c8912e;
  --red: #e63946;
  --text: #f4fbfa;
  --muted: #9cc3bf;
  --font: "Bricolage Grotesque", system-ui, sans-serif;
  --w: clamp(96px, 27vw, 200px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  overflow-x: hidden;
}

@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(70% 50% at 50% 30%, rgba(20, 184, 166, 0.22), transparent 70%),
    radial-gradient(50% 40% at 50% 100%, rgba(242, 196, 109, 0.12), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
}

/* ——— Bokeh lights ——— */
.lights {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.lights span {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 196, 109, 0.55), transparent 70%);
  animation: drift 14s ease-in-out infinite alternate;
}

.lights span:nth-child(1) {
  top: 8%;
  left: 6%;
  width: 120px;
  height: 120px;
}

.lights span:nth-child(2) {
  top: 18%;
  right: 8%;
  width: 80px;
  height: 80px;
  animation-delay: -3s;
  background: radial-gradient(circle, rgba(94, 234, 212, 0.5), transparent 70%);
}

.lights span:nth-child(3) {
  top: 62%;
  left: 12%;
  width: 60px;
  height: 60px;
  animation-delay: -6s;
}

.lights span:nth-child(4) {
  bottom: 6%;
  right: 18%;
  width: 140px;
  height: 140px;
  animation-delay: -9s;
  background: radial-gradient(circle, rgba(230, 57, 70, 0.4), transparent 70%);
}

.lights span:nth-child(5) {
  top: 40%;
  right: 30%;
  width: 40px;
  height: 40px;
  animation-delay: -2s;
}

.lights span:nth-child(6) {
  top: 4%;
  left: 46%;
  width: 50px;
  height: 50px;
  animation-delay: -11s;
  background: radial-gradient(circle, rgba(94, 234, 212, 0.45), transparent 70%);
}

@keyframes drift {
  to {
    transform: translate(30px, -40px) scale(1.2);
    opacity: 0.6;
  }
}

/* ——— Header ——— */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1100px, 100% - 32px);
  margin: 0 auto;
  padding: 16px 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.logo svg {
  width: 26px;
  height: 26px;
  fill: var(--gold);
  filter: drop-shadow(0 0 8px rgba(242, 196, 109, 0.6));
}

.age {
  padding: 4px 10px;
  border: 1.5px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  font-weight: 800;
  font-size: 13px;
}

/* ——— Stage ——— */
.stage {
  flex: 1;
  width: min(1100px, 100% - 32px);
  margin: 0 auto;
  padding: 12px 0 40px;
  text-align: center;
}

.kicker {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid rgba(242, 196, 109, 0.4);
  border-radius: 999px;
  background: rgba(242, 196, 109, 0.08);
  color: var(--gold);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1 {
  margin: 14px 0 10px;
  font-weight: 800;
  font-size: clamp(36px, 8vw, 74px);
  line-height: 1;
  letter-spacing: -0.03em;
}

h1 span {
  background: linear-gradient(180deg, #fff3cf, var(--gold) 55%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 24px rgba(242, 196, 109, 0.35));
}

.lead {
  max-width: 44ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
}

.lead b {
  color: #fff;
}

/* ——— Boxes ——— */
.boxes {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(10px, 4vw, 56px);
  margin: clamp(56px, 9vw, 90px) 0 18px;
}

.box {
  --c1: #14b8a6;
  --c2: #0f766e;
  --lid: #2dd4bf;
  --ribbon: var(--gold);
  position: relative;
  width: var(--w);
  height: calc(var(--w) * 1.05);
  border-radius: 12px;
  animation: float 3.2s ease-in-out infinite;
  transition: opacity 0.4s ease, filter 0.4s ease, transform 0.3s ease;
}

.box:nth-child(2) {
  animation-delay: -1s;
}

.box:nth-child(3) {
  animation-delay: -2s;
}

.box--red {
  --c1: #e63946;
  --c2: #a4161a;
  --lid: #ff5c6a;
}

.box--ink {
  --c1: #23466f;
  --c2: #0b1d33;
  --lid: #2f5d8f;
  --ribbon: #ff5c6a;
}

@keyframes float {
  50% {
    transform: translateY(-10px);
  }
}

.box:hover:not(:disabled) .box__lid,
.box:focus-visible .box__lid {
  transform: translateY(-8px) rotate(-3deg);
}

.box:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 8px;
}

.box:disabled {
  cursor: default;
}

.box__body {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 0;
  height: 62%;
  border-radius: 6px 6px 12px 12px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.14) 0 3px, transparent 3.5px) 0 0 / 22px 22px,
    linear-gradient(180deg, var(--c1), var(--c2));
  box-shadow:
    0 18px 30px rgba(0, 0, 0, 0.45),
    inset 0 -10px 18px rgba(0, 0, 0, 0.25);
}

.box__body::before,
.box__lid::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 17%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.15), transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%, rgba(0, 0, 0, 0.15)), var(--ribbon);
}

.box__lid {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: 25%;
  height: 17%;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--lid), var(--c1));
  box-shadow:
    0 8px 14px rgba(0, 0, 0, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.35s ease;
}

/* Bow */
.box__bow {
  position: absolute;
  left: 50%;
  bottom: 84%;
  width: 58%;
  height: calc(var(--w) * 0.24);
  transform: translateX(-50%);
}

.box__bow::before,
.box__bow::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 52%;
  height: 100%;
  border: calc(var(--w) * 0.055) solid var(--ribbon);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.25));
}

.box__bow::before {
  left: 0;
  border-radius: 60% 40% 10% 60%;
  transform: rotate(-18deg);
  transform-origin: 100% 100%;
}

.box__bow::after {
  right: 0;
  border-radius: 40% 60% 60% 10%;
  transform: rotate(18deg);
  transform-origin: 0 100%;
}

.box__num {
  position: absolute;
  left: 50%;
  bottom: -36px;
  transform: translateX(-50%);
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
}

/* Open state */
.box__rays {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 260%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(242, 196, 109, 0.32) 0 10deg, transparent 10deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 15%, transparent 65%);
  mask: radial-gradient(circle, #000 15%, transparent 65%);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.7s cubic-bezier(0.2, 1.3, 0.4, 1), opacity 0.5s ease;
}

.box__prize {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 38%;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 112%;
  padding: 10px 8px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff8e6, #f6dfaa);
  color: #3d2a05;
  font-weight: 700;
  font-size: clamp(12px, 2.6vw, 16px);
  line-height: 1.1;
  box-shadow:
    0 0 0 3px var(--gold),
    0 12px 30px rgba(242, 196, 109, 0.45);
  transform: translate(-50%, 0) scale(0.3);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) 0.25s, opacity 0.3s ease 0.25s;
}

.box__prize b {
  font-size: clamp(26px, 6vw, 44px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.box.is-shaking {
  animation: shake 0.7s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: none;
  }
  15% {
    transform: rotate(-7deg) translateY(-4px);
  }
  30% {
    transform: rotate(6deg);
  }
  45% {
    transform: rotate(-5deg) translateY(-6px);
  }
  60% {
    transform: rotate(4deg);
  }
  75% {
    transform: rotate(-2deg) translateY(-3px);
  }
}

.box.is-open {
  animation: none;
}

.box.is-open .box__lid {
  transform: translate(-62%, -150%) rotate(-38deg);
  transition: transform 0.6s cubic-bezier(0.2, 1.1, 0.4, 1);
}

.box.is-open .box__rays {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  animation: rays 12s linear infinite;
}

@keyframes rays {
  to {
    transform: translate(-50%, -50%) scale(1) rotate(360deg);
  }
}

.box.is-open .box__prize {
  transform: translate(-50%, -105%) scale(1);
  opacity: 1;
}

.boxes.is-done .box:not(.is-open) {
  opacity: 0.3;
  filter: grayscale(0.8);
  animation: none;
}

/* ——— Hint ——— */
.hint {
  margin-top: 52px;
  color: var(--muted);
  font-weight: 700;
}

.hint span {
  display: inline-block;
  color: var(--gold);
  animation: bob 1.2s ease-in-out infinite;
}

@keyframes bob {
  50% {
    transform: translateY(-5px);
  }
}

.hint.is-ready {
  color: #fff;
}

.hint .cta-inline {
  display: inline-flex;
  width: auto;
  margin-top: 0;
  padding: 0 34px;
}

/* ——— Perks ——— */
.perks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
  list-style: none;
}

.perks li {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 14px;
}

.perks b {
  color: var(--gold);
}

/* ——— Footer ——— */
.foot {
  width: min(1100px, 100% - 32px);
  margin: 0 auto;
  padding: 20px 0 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.foot p + p {
  margin-top: 6px;
}

.foot .demo {
  opacity: 0.75;
}

/* ——— Sparks ——— */
.sparks {
  position: fixed;
  inset: 0;
  z-index: 40;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ——— CTA ——— */
.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 60px;
  margin-top: 20px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff3cf, var(--gold) 50%, var(--gold-deep));
  color: #2c1d02;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow:
    0 10px 26px rgba(242, 196, 109, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.7);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 30px rgba(242, 196, 109, 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

.cta:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* ——— Modal ——— */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 13, 16, 0.75);
  backdrop-filter: blur(6px);
  animation: fade 0.3s ease;
}

.modal[hidden] {
  display: none;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.modal__card {
  position: relative;
  width: min(420px, 100%);
  padding: 32px 24px 24px;
  border-radius: 24px;
  background:
    radial-gradient(100% 60% at 50% 0%, rgba(20, 184, 166, 0.3), transparent 70%),
    linear-gradient(180deg, #0b2b33, #071c22);
  border: 1px solid rgba(242, 196, 109, 0.45);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  text-align: center;
  animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes pop {
  from {
    transform: scale(0.75);
    opacity: 0;
  }
}

.modal__card h2 {
  font-weight: 800;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
}

.modal__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.modal__kicker {
  margin-bottom: 6px;
  color: var(--gold);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.modal__sub {
  margin-top: 6px;
  color: var(--muted);
}

.ticket {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 2px dashed rgba(242, 196, 109, 0.6);
  border-radius: 16px;
  background: rgba(242, 196, 109, 0.06);
}

.ticket div {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.ticket b {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--gold);
}

.ticket span {
  color: #fff;
  font-weight: 700;
}

.ticket i {
  color: var(--teal);
  font-style: normal;
  font-weight: 800;
  font-size: 28px;
}

.modal__fine {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.modal__link {
  display: inline-block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
