[hidden] { display: none !important; }

/* Align the live aperture with the ring in the welcome film. */
#portalLive {
  --welcome-frame: min(100vw, 100vh);
  position: absolute;
  left: calc(50% + 0.0005 * var(--welcome-frame));
  top: calc(50% + 0.002 * var(--welcome-frame));
  width: min(76.80vw, 76.80vh);
  height: min(76.80vw, 76.80vh);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  clip-path: circle(50%);
  contain: paint;
  background: #080908;
  opacity: 1;
  pointer-events: none;
  overflow: hidden;
  transition: opacity .25s ease;
}
#portalLive.visible { opacity: 1; }
#portalRing { position:absolute; left:50%; top:50%; width:min(100vw,100vh); height:min(100vw,100vh); transform:translate(-50%,-50%); z-index:2; pointer-events:none; opacity:1; }
.in-video-call #portalRing { opacity:1; }
#screen #portalLive #idlePortrait {
  position: absolute;
  inset: auto;
  left: 50%;
  top: 50%;
  width: 145%;
  height: 145%;
  max-width: none;
  margin: 0;
  transform: translate(-50%, -50%);
  object-fit: contain;
}
.in-video-call #idlePortrait { visibility: hidden; }
#screen.cc-hold #portalLive,
#screen.cc-hold #portalRing { visibility: hidden; }
#portalLive .live-media {
  position: absolute;
  inset: auto;
  left: 50%;
  top: 58.14%;
  width: 154.62%;
  height: 103.08%;
  max-width: none;
  margin: 0;
  transform: translate(-50%, -50%);
  object-fit: contain;
}
#callStatus {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  color: #efefef;
  font: 600 13px/1.4 system-ui, sans-serif;
}
#liveTimer { font-variant-numeric: tabular-nums; }
#micStatus[data-muted="true"] { color: #ffcab9; }
#callControls {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  padding: 9px 12px 12px;
  border: 1px solid #424242;
  border-radius: 20px;
  background: #151515;
  z-index: 1002;
  white-space: nowrap;
}
#callControls .call-actions { display: flex; gap: 8px; }
#cameraStatus { margin: 0; color: #f4dfb0; text-align: center; font: 600 13px/1.4 system-ui, sans-serif; }
#callControls:has(#stopCamera:not([hidden])) { width: max-content; max-width: calc(100vw - 24px); box-sizing: border-box; }
#callControls:has(#stopCamera:not([hidden])) .call-actions { flex-wrap: wrap; justify-content: center; }
.in-video-call #phoneNumber,
.in-video-call #liveBtn,
.in-video-call #videoCodeBtn,
.in-video-call #infoBtn,
.in-video-call #youtubeTicket { visibility: hidden; }

#videoCodeBtn {
  position: fixed;
  z-index: 1000;
  bottom: 0;
  left: calc(50% + 100px);
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid #e7c979;
  border-radius: 999px;
  background: #17130f;
  color: #fff;
  font: 700 16px/1.15 system-ui, sans-serif;
  cursor: pointer;
}

#youtubeTicket {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 20;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 16px;
  border: 1px solid #e7c979;
  border-radius: 999px;
  background: #17130f;
  color: #f6df9f;
  font: 700 15px/1.2 system-ui, sans-serif;
  text-decoration: none;
}

#youtubeTicket:focus-visible {
  outline: 3px solid white;
  outline-offset: 3px;
}

#hearSanta {
  top: calc(50% + min(92vw, 92svh) * .43 - 34px);
  bottom: auto;
  transform: translateX(-50%) scale(.72);
  font-size: clamp(14px, 2vw, 16px);
  padding: 8px 14px;
  min-height: 40px;
  animation: hear-santa-pulse 1s ease-in-out 5;
}
@keyframes hear-santa-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
#liveBtn {
  box-sizing: border-box;
  width: 166px;
  min-height: 49px;
  padding: 4px 8px;
  border: 1px solid #e7c979;
  font: 900 19px/1.1 system-ui, sans-serif;
  white-space: nowrap;
  animation: live-pulse 1s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.65); }
}
#liveBtn.activated { animation: none; }
#infoBtn {
  box-sizing: border-box;
  width: 52px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  font-weight: 800;
}
@media (prefers-reduced-motion: reduce) {
  #hearSanta, #liveBtn { animation: none; }
}

/* Regrouper les commandes à intervalles réguliers sous le cerceau. */
@media (min-width: 769px) {
  #phoneNumber {
    left: calc(50% - 0.30 * max(100vw, 179.18svh) + 65px);
    transform: translateX(-50%);
    box-sizing: border-box;
    width: 130px;
    min-height: 44px;
    padding: 4px 8px;
    font-size: 13.5px;
  }
  #phoneNumber .call-label { font-size: 9px; }
  #liveBtn { left: 50%; }
  #videoCodeBtn { left: calc(50% + 100px); }
  #infoBtn {
    left: calc(50% - 0.30 * max(100vw, 179.18svh) + 140px);
    right: auto;
  }
}
#youtubeTicket {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  top: max(calc(env(safe-area-inset-top) + 6px), calc(50% - min(92vw, 92svh) * .5 - 26px));
  min-height: 28px;
  padding: 2px 12px;
  box-sizing: border-box;
  font-size: 13px;
  white-space: nowrap;
  width: min(270px, calc(100vw - 24px));
  overflow: hidden;
  padding-inline: 0;
}
.ticket-track { display: flex; width: max-content; animation: ticket-scroll 15s linear infinite; }
.ticket-track span { flex: none; padding-right: 3rem; }
@keyframes ticket-scroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticket-track { animation: none; }
  #youtubeTicket { width: auto; max-width: calc(100vw - 24px); white-space: normal; padding: 4px 12px; }
  .ticket-track { width: auto; }
  .ticket-track span { white-space: normal; padding: 0; }
  .ticket-track span + span { display: none; }
}
@media (max-width: 768px) {
  #infoBtn { left: auto; right: 10px; }
  #youtubeTicket { font-size: 12px; }
}
#callControls button, #panel button {
  min-height: 44px;
  font: 700 15px/1.3 system-ui, sans-serif;
  cursor: pointer;
}
#callControls button {
  padding: 9px 14px;
  border: 1px solid #606060;
  border-radius: 999px;
  background: #292929;
  color: #fff;
}
#callControls #muteMic[data-muted="true"] { background: #fff; color: #171717; }
#callControls #endCall { background: #ab1820; border-color: #ab1820; }
#panel {
  box-sizing: border-box;
  width: min(430px, calc(100vw - 26px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 29px;
  border: 1px solid #bca36b;
  border-radius: 20px;
  background: #17130f;
  color: #fff;
  font: 16px/1.45 system-ui, sans-serif;
  box-shadow: 0 12px 48px #0008;
}
#panel::backdrop { background: #0006; }
#panel h1 { margin: 6px 26px 15px 0; color: #f4dfb0; font-size: 25px; line-height: 1.2; }
#panel p { margin: 10px 0; }
#panel .price { font-size: 20px; font-weight: 720; }
#panel .small { color: #d8ccbb; font-size: 14px; }
#panel a { color: #f4dfb0; text-underline-offset: 3px; }
#panel label { display: block; margin: 14px 0; }
#panel .consent { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
#panel .camera-choice { margin-block: 12px; padding: 10px 12px; border: 1px solid #8a7653; border-radius: 10px; }
#panel .camera-choice label, #panel .camera-choice p { margin: 0; }
#panel .camera-choice p { margin-top: 7px; }
#panel input[type="checkbox"] { flex: 0 0 20px; width: 20px; height: 20px; accent-color: #c00; }
#panel select {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 6px 10px;
  border: 1px solid #bca36b;
  border-radius: 8px;
  background: #221e18;
  color: #fff;
  font: inherit;
}
#closePanel { position: absolute; top: 6px; right: 8px; width: 44px; border: 0; background: none; color: #fff; font-size: 25px !important; }
#panel .primary, #panel .secondary { width: 100%; margin-top: 9px; padding: 9px 13px; border-radius: 999px; color: #fff; }
#panel .primary { background: #c00; border: 1px solid #c00; }
#panel .secondary { background: transparent; border: 1px solid #8a7653; }
#panel .code-field {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid #8a7653;
  border-radius: 8px;
  background: #231d14;
  color: #fff;
  font: 700 18px/1.2 ui-monospace, monospace;
}
#panel .displayed-code {
  display: block;
  margin: 14px 0;
  color: #f4dfb0;
  font: 700 clamp(16px, 4vw, 23px)/1.4 ui-monospace, monospace;
  user-select: all;
}
#panel button:disabled { cursor: wait; opacity: .6; }
#panelError:empty { display: none; }
#panelError { color: #ffcfbd; font-size: 14px; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #f3db99; outline-offset: 4px; }
@media (max-width: 768px) {
  #videoCodeBtn { left: 0; max-width: calc(50% - 76px); padding: 6px 9px; font-size: 14px; }
  #panel { position: fixed; inset: auto 0 max(10px, env(safe-area-inset-bottom)); margin: auto; max-height: 65dvh; padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  #portalLive { transition: none; }
}

/* Décor de la page d’accueil pour les écrans de taille tablette ou supérieure. */
@media (min-width: 601px) {
  #screen::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #000 url("/assets/decor-candy.webp") center center / cover no-repeat;
    pointer-events: none;
  }

  /* Le film contient le cerceau : retirer uniquement le noir autour. */
  #screen #idleVideo {
    inset: auto;
    left: 50%;
    top: 50%;
    width: min(92vw, 92vh);
    height: min(92vw, 92vh);
    transform: translate(-50%, -50%);
    clip-path: circle(47.6% at 50% 50%);
  }
}

/* Conserver la présentation actuelle sur les téléphones en paysage. */
@media (max-width: 950px) and (max-height: 600px) {
  #screen::before { display: none; }
  #screen #idleVideo { inset: 0; left: 0; top: 0; width: 92%; height: 92%; transform: none; clip-path: none; }
}

/* Le dialogue natif reste au-dessus de la scène. */
#ccGuide { display: none; }
#ccCanvas,
#ccPatch {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#ccPatch {
  background: center / cover no-repeat url("/assets/candy-cane-decor-sans-personnage.png");
}
#screen.cc-playing #ccCanvas,
#screen.cc-playing #ccPatch { display: block; }
#screen.cc-hold #idleVideo { visibility: hidden; }

@media (max-width: 768px) {
  #phoneNumber, #liveBtn, #videoCodeBtn, #infoBtn {
    box-sizing: border-box;
    position: fixed;
    top: auto;
    bottom: max(4px, env(safe-area-inset-bottom));
    min-height: 46px;
    transform: none;
    margin: 0;
    padding: 4px;
    border-radius: 999px;
    text-align: center;
  }
  #phoneNumber {
    left: 1%;
    width: 22%;
    background: #c00;
    color: #fff;
    font: 700 clamp(9px, 2.3vw, 12px)/1.1 system-ui, sans-serif;
    letter-spacing: 0;
    -webkit-text-stroke: 0;
    text-shadow: none;
  }
  #phoneNumber .call-label { display: block; font-size: 9px; }
  #infoBtn { left: 24%; right: auto; width: 12%; font-size: clamp(11px, 3vw, 14px); }
  #liveBtn { left: 37%; width: 33%; font-size: clamp(12px, 3.6vw, 17px); }
  #videoCodeBtn { left: 71%; width: 28%; max-width: none; font-size: clamp(11px, 3vw, 14px); }
}
