/* ---------- Trailer ---------- */
#player { background: #000; display: grid; place-items: center; }
#player::before {
  content: "";
  position: absolute;
  inset: -40px;
  background: url(../poster.jpg) center / cover;
  filter: blur(40px) brightness(.45) saturate(1.3);
}
#trailer { position: relative; width: 100%; height: 100%; object-fit: contain; }
.progress {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--safe-top);
  z-index: 2;
  height: 3px;
  background: rgba(255, 255, 255, .14);
}
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--orange), var(--gold)); }
.paused {
  position: absolute;
  z-index: 1;
  font-size: 64px;
  opacity: .85;
  pointer-events: none;
  text-shadow: 0 0 20px #000;
}
.chip {
  position: absolute;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  z-index: 3;
  transform: translateX(-50%);
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  font: 800 16px var(--ui);
  color: #1a0b2e;
  background: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
  animation: pulse-ring 1.4s infinite;
}
.overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2vh;
  padding: 24px 16px;
  text-align: center;
}

/* ---------- Bilan de mission ---------- */
#results {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  place-items: center;
  padding: calc(20px + var(--safe-top)) 16px 0;
  background:
    radial-gradient(ellipse 90% 50% at 50% 105%, rgba(255, 62, 165, .32), transparent 70%),
    radial-gradient(ellipse 70% 40% at 50% -5%, rgba(177, 92, 255, .28), transparent 70%),
    var(--night);
  animation: fadein .8s ease;
}
.results { position: relative; z-index: 8; width: min(100%, 460px); text-align: center; }
.r-kicker {
  font-family: var(--display);
  font-size: clamp(30px, 9.4vw, 46px);
  text-transform: uppercase;
  color: #f7c843;
  text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
}
.r-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(17px, 4.8vw, 22px);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.r-title .name { display: block; margin-top: 2px; font-size: clamp(58px, 18vw, 96px); }
/* Le cadeau, en tête du bilan : la vraie récompense de la mission. */
.gift {
  position: relative;
  margin: 1.6vh auto 0;
  padding: 12px 16px 14px;
  border-radius: 16px;
  background:
    linear-gradient(#150a2c, #150a2c) padding-box,
    linear-gradient(120deg, var(--gold), var(--pink) 45%, var(--cyan)) border-box;
  border: 2px solid transparent;
  box-shadow: 0 10px 30px rgba(255, 62, 165, .25);
  opacity: 0;
  transform: scale(.88);
  transition: opacity .35s ease, transform .45s cubic-bezier(.2, 1.4, .4, 1);
}
.gift.show { opacity: 1; transform: none; }
.gift-label { font: 800 12px var(--ui); letter-spacing: .2em; text-transform: uppercase; color: var(--hud-yellow); }
.gift-name {
  margin-top: 4px;
  font-family: var(--display);
  font-size: clamp(24px, 7.4vw, 34px);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.gift-platform {
  display: inline-block;
  margin-left: 4px;
  padding: 3px 9px 2px;
  border-radius: 7px;
  font-size: .62em;
  letter-spacing: .08em;
  vertical-align: .22em;
  color: #fff;
  background: #0070d1;
}

.stats {
  margin: 2.2vh 0 1vh;
  padding: 8px 14px;
  list-style: none;
  text-align: left;
  border-radius: 12px;
  background: rgba(0, 0, 0, .42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}
.stats li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 0;
  font: 650 15px var(--ui);
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity .3s ease, transform .3s ease;
}
.stats li + li { border-top: 1px solid rgba(255, 255, 255, .08); }
.stats li.show { opacity: 1; transform: none; }
.stats .dots { flex: 1; border-bottom: 2px dotted rgba(255, 255, 255, .22); transform: translateY(-4px); }
.stats .value { font-family: var(--display); font-size: 20px; letter-spacing: .04em; }
.stats .tick { color: var(--hud-green); font-weight: 900; }
.r-note { min-height: 1.2em; font: italic 600 13px var(--ui); color: #d9c6f5; }
.medal {
  display: inline-block;
  margin: 14px 0 24px;
  padding: 9px 18px;
  border-radius: 999px;
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #241600;
  background: linear-gradient(90deg, #8a6200, #f7c843 30%, #fff2b0 50%, #f7c843 70%, #8a6200);
  box-shadow: 0 0 20px rgba(247, 200, 67, .2);
  opacity: 0;
  transform: scale(1.7);
  transition: opacity .35s ease, transform .35s cubic-bezier(.2, 1.4, .4, 1);
}
.medal.show { opacity: 1; transform: none; }
.medal.argent { color: #1c2230; background: linear-gradient(90deg, #5d6675, #d9e0ea 30%, #ffffff 50%, #d9e0ea 70%, #5d6675); box-shadow: 0 0 20px rgba(217, 224, 234, .2); }
.medal.bronze { color: #2a1406; background: linear-gradient(90deg, #6b3410, #d98a4e 30%, #ffd2a6 50%, #d98a4e 70%, #6b3410); box-shadow: 0 0 20px rgba(217, 138, 78, .2); }
.medal.chocolat { color: #fff3e6; background: linear-gradient(90deg, #3b1d0e, #7a3f1d 30%, #a0603a 50%, #7a3f1d 70%, #3b1d0e); box-shadow: 0 0 20px rgba(122, 63, 29, .25); }
.r-record { min-height: 1.2em; margin: -14px 0 18px; font: 800 13px var(--ui); letter-spacing: .06em; color: var(--hud-yellow); }
.countdown {
  margin-bottom: 2.2vh;
  padding: 14px 12px 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 62, 165, .22), rgba(177, 92, 255, .2));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}
.cd-label { font: 800 12px var(--ui); letter-spacing: .14em; text-transform: uppercase; color: #ffd9ec; }
.cd-value {
  margin-top: 4px;
  font-family: var(--display);
  font-size: clamp(40px, 12vw, 58px);
  line-height: 1;
  background: linear-gradient(180deg, #ff5fc1, var(--orange) 60%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(3px 4px 0 #2a0a3a);
}
.cd-time { margin-top: 4px; font: 700 15px var(--ui); font-variant-numeric: tabular-nums; color: #f3e8ff; }
.cd-sub { margin-top: 6px; font-size: clamp(26px, 7.5vw, 34px); }

@media (max-height: 720px) {
  .r-kicker { font-size: clamp(26px, 8vw, 36px); }
  .r-title .name { font-size: min(16vw, 10vh); }
  .stats { margin: 10px 0 6px; }
  .stats li { padding: 6px 0; }
  .medal { margin: 8px 0 14px; padding: 7px 16px; }
  .countdown { padding: 10px 12px 8px; margin-bottom: 14px; }
  .cd-value { font-size: clamp(32px, 10vw, 44px); }
  .cd-sub { font-size: 24px; }
}

/* ---------- Gros bouton vers les vœux des invités, toujours visible en bas du bilan ---------- */
.wishes-bar {
  position: sticky;
  bottom: 0;
  z-index: 9;
  margin: 10px -16px 0;
  padding: 26px 16px calc(14px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(11, 6, 32, 0), rgba(11, 6, 32, .94) 38%);
}
.wishes {
  display: block;
  padding: .72em 1em;
  border-radius: 18px;
  font-family: var(--display);
  font-size: clamp(24px, 7vw, 32px);
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(90deg, var(--pink), var(--orange) 60%, var(--gold));
  box-shadow: 0 12px 34px rgba(255, 62, 165, .45), inset 0 0 0 2px rgba(255, 255, 255, .35);
  text-shadow: 2px 2px 0 rgba(90, 0, 50, .5);
  animation: pulse-ring 1.8s infinite;
}
.wishes:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; }
