/* ============================================================
   AFTERWORK BY HEINEKEN — jeu concours
   ============================================================ */
:root {
  --g: #008a3e;
  --g-mid: #00702f;
  --g-deep: #003d1a;
  --g-ring: #4bab3e;
  --g-light: #7fd36b;
  --red: #e3001b;
  --gold: #ffcf3f;
  --white: #fff;
  --ink: #062611;
  --glass: rgba(0, 45, 18, .38);
  --line: rgba(255, 255, 255, .22);
  --radius: 22px;
  --ease: cubic-bezier(.2, .9, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --marker: "Permanent Marker", "Comic Sans MS", cursive;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  color: var(--white);
  background: var(--g-deep);
  background:
    radial-gradient(120% 80% at 70% 20%, #0aa04a 0%, transparent 60%),
    radial-gradient(90% 70% at 10% 100%, #00561f 0%, transparent 70%),
    linear-gradient(160deg, var(--g) 0%, var(--g-mid) 55%, var(--g-deep) 100%);
  background-attachment: fixed;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

/* ---------- décor ---------- */
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.ring {
  position: fixed; z-index: 0; pointer-events: none;
  width: min(70vw, 620px); aspect-ratio: 0.78;
  right: -8vw; top: 50%;
  border: clamp(18px, 3.4vw, 42px) solid var(--g-ring);
  border-radius: 999px; opacity: .55;
  transform: translateY(-50%) rotate(-8deg);
  animation: float 14s ease-in-out infinite;
}
.glow {
  position: fixed; z-index: 0; pointer-events: none;
  width: 60vmax; height: 60vmax; left: -20vmax; top: -25vmax;
  background: radial-gradient(circle, rgba(255, 255, 255, .14), transparent 60%);
  animation: float 18s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: -2vw 2.5vh; }
}

.marker { font-family: var(--marker); font-weight: 400; letter-spacing: .02em; line-height: 1.05; }
.muted { color: rgba(255, 255, 255, .78); }
.small { font-size: .85rem; line-height: 1.5; }

/* ---------- écrans ---------- */
.stage { position: relative; z-index: 2; flex: 1; display: grid; }
.screen {
  grid-area: 1 / 1;
  display: none;
  padding: max(20px, env(safe-area-inset-top)) 16px 24px;
  min-height: 100%;
}
.screen.is-active { display: flex; animation: screenIn .7s var(--ease) both; }
.screen.is-leaving { display: flex; animation: screenOut .45s var(--ease) both; pointer-events: none; }
@keyframes screenIn { from { opacity: 0; transform: translateY(24px) scale(.98); filter: blur(6px); } }
@keyframes screenOut { to { opacity: 0; transform: translateY(-20px) scale(1.02); filter: blur(6px); } }

/* ---------- boutons ---------- */
.btn {
  position: relative; overflow: hidden;
  border: 0; cursor: pointer;
  padding: 16px 28px; border-radius: 999px;
  font-weight: 800; font-size: 1rem; letter-spacing: .04em; text-transform: uppercase;
  transition: transform .2s var(--spring), box-shadow .2s, background .2s;
}
.btn:active { transform: scale(.96); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.btn-primary {
  color: var(--white);
  background: linear-gradient(180deg, #ff2a3d, var(--red) 55%, #b80015);
  box-shadow: 0 10px 28px -8px rgba(227, 0, 27, .75), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.btn-ghost { background: rgba(255, 255, 255, .1); border: 2px solid rgba(255, 255, 255, .55); }
.btn-ghost:hover { background: rgba(255, 255, 255, .2); }
.btn-xl { width: 100%; padding: 19px 24px; font-size: 1.08rem; margin-top: 8px; }

/* ---------- 0. âge ---------- */
.gate { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.gate-logo { width: min(240px, 60vw); height: auto; margin-bottom: 18px; filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .25)); }
.gate h1 { font-size: clamp(2.6rem, 9vw, 4.4rem); margin: 0; text-shadow: 0 4px 0 rgba(0, 0, 0, .15); }
.gate-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.gate-no { font-weight: 700; }

/* ---------- 1. formulaire ---------- */
.play {
  flex-direction: column; align-items: center; justify-content: center;
  gap: 0; max-width: 1180px; width: 100%; margin: 0 auto;
}
.hero {
  position: relative; z-index: 1;
  height: clamp(240px, 36vh, 340px);
  margin-bottom: 18px;
  display: flex; justify-content: center;
}
.hero::before {
  content: ""; position: absolute; z-index: -1;
  left: 50%; top: 50%; width: 150%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 60%);
}
.hero-img {
  height: 100%; width: auto;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .3));
  animation: heroIn 1.1s var(--ease) both, bob 6s ease-in-out 1.1s infinite;
}
@keyframes heroIn { from { opacity: 0; transform: translateY(40px) scale(.94); } }
@keyframes bob { 50% { transform: translateY(-8px); } }
.bubble-tag {
  position: absolute; left: calc(50% + 34px); top: 8%;
  width: 92px; height: 92px; border-radius: 50%;
  display: grid; place-content: center; text-align: center;
  background: var(--red); color: #fff;
  font-weight: 800; font-size: .72rem; text-transform: uppercase; line-height: 1.1;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .3), inset 0 0 0 4px rgba(255, 255, 255, .9);
  transform: rotate(12deg);
  animation: pop .8s var(--spring) .8s both, wiggle 3s ease-in-out 2s infinite;
}
.bubble-tag b { font-size: 1.55rem; display: block; }
@keyframes pop { from { transform: scale(0) rotate(-40deg); } }
@keyframes wiggle { 0%, 100% { rotate: 0deg; } 50% { rotate: -8deg; } }

.card {
  position: relative; z-index: 2;
  width: min(100%, 460px);
  padding: 26px 22px 24px;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .18);
  animation: cardIn .9s var(--ease) .15s both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(40px); } }
.aw-logo { width: min(260px, 72%); height: auto; margin: 0 auto 10px; }
.title { text-align: center; font-size: 1.3rem; font-weight: 800; margin: 6px 0 22px; line-height: 1.25; }
.title .marker { color: var(--gold); font-size: 1.5em; display: inline-block; transform: rotate(-3deg); }
.closed { text-align: center; font-weight: 700; font-size: 1.1rem; padding: 12px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.field { position: relative; margin-bottom: 14px; }
.field input {
  width: 100%;
  padding: 24px 18px 10px;
  font: 600 1.06rem var(--sans);
  color: var(--ink);
  background: rgba(255, 255, 255, .96);
  border: 2px solid transparent;
  border-radius: 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 5px rgba(255, 207, 63, .3); }
.field label {
  position: absolute; left: 19px; top: 50%;
  transform: translateY(-50%);
  color: #5d7466; font-weight: 600; font-size: 1rem;
  pointer-events: none;
  transition: all .2s var(--ease);
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: 15px; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--g);
}
.field-phone input { padding-left: 76px; letter-spacing: .06em; }
.field-phone label { left: 77px; }
.field-phone .prefix {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%); z-index: 1;
  padding: 7px 9px; border-radius: 10px;
  background: var(--g); color: #fff; font-weight: 800; font-size: .9rem;
}
.field.invalid input { border-color: #ff5a6a; animation: shake .4s; }
.field.valid input { border-color: var(--g-light); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.err { display: block; min-height: 0; color: #ffd3d8; font-weight: 700; font-size: .8rem; padding: 4px 6px 0; }
.err:empty { display: none; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: .82rem; line-height: 1.45; cursor: pointer; margin: 6px 2px 4px; color: rgba(255, 255, 255, .88); }
.check input { position: absolute; opacity: 0; }
.check .box {
  flex: none; width: 24px; height: 24px; border-radius: 7px; margin-top: 1px;
  border: 2px solid rgba(255, 255, 255, .7); display: grid; place-items: center;
  transition: background .2s, border-color .2s;
}
.check .box::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg) scale(0); transition: transform .25s var(--spring); margin-top: -3px; }
.check input:checked + .box { background: var(--red); border-color: var(--red); }
.check input:checked + .box::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible + .box { outline: 3px solid var(--gold); outline-offset: 2px; }

.btn .spin { display: none; width: 22px; height: 22px; border: 3px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: rot .8s linear infinite; margin: 0 auto; }
.btn.loading .lbl { display: none; }
.btn.loading .spin { display: block; }
.btn:disabled { cursor: progress; }
@keyframes rot { to { transform: rotate(360deg); } }
.form-msg { text-align: center; font-weight: 700; min-height: 1.2em; margin: 12px 0 0; color: #ffd3d8; }

@media (min-width: 900px) {
  .play { flex-direction: row; gap: 6vw; }
  .hero { height: min(80vh, 680px); margin: 0; flex: 0 0 auto; }
  .bubble-tag { width: 118px; height: 118px; font-size: .85rem; left: calc(50% + 80px); top: 6%; }
  .bubble-tag b { font-size: 2rem; }
  .card { padding: 34px 34px 30px; }
  .ring { right: 2vw; }
}
@media (max-width: 899px) {
  .bubble-tag { width: 76px; height: 76px; font-size: .62rem; }
  .bubble-tag b { font-size: 1.25rem; }
  .ring { width: 90vw; right: -40vw; opacity: .4; }
}

/* ---------- 2. capsule ---------- */
.reveal, .result, .notice { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; }
.big { font-size: clamp(2.4rem, 9vw, 4.2rem); margin: 0; transform: rotate(-2deg); text-shadow: 0 4px 0 rgba(0, 0, 0, .15); }
.cap-wrap {
  position: relative; margin-top: 26px;
  width: min(72vw, 300px); aspect-ratio: 1;
  background: none; border: 0; padding: 0; cursor: pointer;
  border-radius: 50%;
}
.cap-wrap:focus-visible { outline: 4px solid var(--gold); outline-offset: 8px; }
.cap-wrap::before {
  content: ""; position: absolute; inset: -14%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 207, 63, .45), transparent 65%);
  animation: halo 2s ease-in-out infinite;
}
@keyframes halo { 50% { transform: scale(1.12); opacity: .6; } }
.cap {
  position: relative; width: 100%; height: 100%;
  filter: drop-shadow(0 22px 26px rgba(0, 0, 0, .45));
  animation: capIdle 2.4s ease-in-out infinite;
}
@keyframes capIdle {
  0%, 100% { transform: rotate(0) scale(1); }
  10% { transform: rotate(-7deg) scale(1.03); }
  20% { transform: rotate(6deg) scale(1.03); }
  30% { transform: rotate(0) scale(1); }
}
.cap-wrap.shake .cap { animation: capShake .55s linear; }
@keyframes capShake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  15% { transform: translate(-6px, 2px) rotate(-10deg); }
  30% { transform: translate(6px, -2px) rotate(10deg); }
  45% { transform: translate(-5px, 1px) rotate(-8deg); }
  60% { transform: translate(5px, -1px) rotate(8deg); }
  80% { transform: translate(-2px, 0) rotate(-3deg) scale(.95); }
}
.cap-wrap.popped .cap { animation: capPop .9s cubic-bezier(.3, .6, .3, 1) forwards; }
.cap-wrap.popped::before, .cap-wrap.popped .tap-hint { opacity: 0; transition: opacity .2s; }
@keyframes capPop {
  0% { transform: translateY(0) rotate(0) scale(.95); }
  100% { transform: translateY(-120vh) rotate(720deg) scale(.5); opacity: .4; }
}
.tap-hint { position: absolute; right: -4%; bottom: 2%; font-size: 2.6rem; animation: tap 1.2s ease-in-out infinite; }
@keyframes tap { 50% { transform: translate(-8px, -8px) scale(.9); } }

/* ---------- 3. résultat ---------- */
.kicker { font-weight: 800; text-transform: uppercase; letter-spacing: .14em; font-size: .9rem; color: var(--gold); margin: 0; }
.prize { position: relative; width: min(64vw, 240px); aspect-ratio: 1; display: grid; place-items: center; margin: 4px 0; }
.prize-burst {
  position: absolute; inset: -30%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .18) 0 9deg, transparent 9deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 25%, transparent 68%);
          mask: radial-gradient(circle, #000 25%, transparent 68%);
  animation: rot 18s linear infinite;
}
.prize-media {
  position: relative;
  width: 86%; aspect-ratio: 1; border-radius: 50%;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 0 8px var(--red), 0 0 0 14px #fff, 0 26px 50px rgba(0, 0, 0, .4);
}
.prize-media img { width: 100%; height: 100%; object-fit: contain; padding: 9%; }
.result.is-active .prize-media { animation: prizeIn 1s var(--spring) .2s both; }
@keyframes prizeIn { from { transform: scale(0) rotate(-180deg); } }
.prize-name {
  font-family: var(--marker); font-size: clamp(1.9rem, 7.5vw, 3rem);
  margin: 6px 0 4px; line-height: 1.1;
  color: var(--white); text-shadow: 0 3px 0 rgba(0, 0, 0, .2);
}
.result.is-active .prize-name { animation: screenIn .7s var(--ease) .6s both; }
.result .btn { margin-top: 8px; }

/* ---------- 4. message ---------- */
.notice-icon { font-size: 4.5rem; animation: pop .7s var(--spring) both; }
.notice p { max-width: 420px; font-weight: 600; line-height: 1.5; }

/* ---------- pied de page ---------- */
.legal {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, .28);
  font-size: .7rem; font-weight: 600; text-align: left; line-height: 1.35;
}
.legal img { width: 54px; height: auto; flex: none; }
.legal p { margin: 0; max-width: 560px; }

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