/* ==========================================================================
   CHASSE AU CADEAU — feuille de style joueur
   Direction : fond uni, angles droits, aucun dégradé.
   Les couleurs sont injectées par PHP dans :root (par restaurant).
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: #fff;
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#app { position: fixed; inset: 0; overflow: hidden; background: var(--bg); }

/* ---------- Écrans ---------- */
.screen {
  position: absolute; inset: 0;
  display: none; flex-direction: column;
  padding: max(22px, env(safe-area-inset-top)) 22px max(22px, env(safe-area-inset-bottom));
  overflow-y: auto;
  background: var(--bg);
}
.screen.is-active { display: flex; }
.screen--center { justify-content: flex-start; align-items: center; text-align: center; }
/* centrage qui ne coupe jamais le haut : deux ressorts vides se partagent la place libre,
   et disparaissent quand le contenu dépasse (l'écran devient alors simplement défilable) */
.screen--center::before, .screen--center::after { content: ""; flex: 1 0 0; min-height: 0; }

/* ---------- Éléments de base ---------- */
.logo { max-height: 120px; max-width: 82%; object-fit: contain; margin-bottom: 20px; }
.brand-name {
  font-size: 1rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 10px; font-weight: 700;
}
h1 { font-family: "Bricolage Grotesque", "Manrope", sans-serif;
     font-size: clamp(1.9rem, 8vw, 2.6rem); line-height: 1.04; margin: 0 0 14px;
     font-weight: 800; text-wrap: balance; letter-spacing: -.02em; }
h2 { font-family: "Bricolage Grotesque", "Manrope", sans-serif;
     font-size: 1.35rem; margin: 0 0 10px; font-weight: 700; letter-spacing: -.01em; }
p  { font-size: 1rem; line-height: 1.55; color: rgba(255,255,255,.8); margin: 0 0 14px; }
.muted { color: rgba(255,255,255,.5); font-size: .86rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 17px 22px; border: 0; border-radius: 0;
  font-size: 1.06rem; font-weight: 800; font-family: inherit;
  letter-spacing: .02em;
  background: var(--primary); color: var(--on-primary); cursor: pointer;
  transition: opacity .15s ease;
}
.btn:active { opacity: .82; }
.btn[disabled] { opacity: .35; pointer-events: none; }
.btn--ghost { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.35); }
.btn--accent { background: var(--accent); color: #fff; }
.btn:focus-visible, .task:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.card {
  width: 100%; max-width: 460px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14);
  border-radius: 0; padding: 22px;
}
.stack { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 460px; }

.rules { list-style: none; padding: 0; margin: 0 0 22px; text-align: left; width: 100%; max-width: 460px; }
.rules li { display: flex; gap: 13px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.rules li:last-child { border-bottom: 0; }
.rules .n {
  flex: 0 0 30px; height: 30px; display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary); font-weight: 800; font-size: .9rem;
}
.rules span:last-child { font-size: .96rem; line-height: 1.4; color: rgba(255,255,255,.88); }

.prize-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 20px; }
.chip {
  padding: 8px 14px; font-size: .88rem; font-weight: 600;
  background: transparent; border: 1px solid rgba(255,255,255,.22);
}

/* ---------- Écran de chasse ---------- */
#camera {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: #000; z-index: 0;
}
#screen-hunt { padding: 0; background: #000; }
/* Repli si la caméra n'est pas disponible : fond uni, pas de dégradé */
#screen-hunt.nocam #camera { display: none; }
#screen-hunt.nocam { background: #15171c; }
#hunt-layer { position: absolute; inset: 0; z-index: 1; }

/* ---------- Cadeau 3D ---------- */
.target {
  position: absolute; z-index: 3;
  width: 118px; height: 118px; margin: -59px 0 0 -59px;
  perspective: 620px; cursor: pointer;
  transition: opacity .18s linear;
}
.box3d {
  position: absolute; inset: 22px;
  transform-style: preserve-3d;
  animation: spin3d 7s linear infinite, bob 2.8s ease-in-out infinite;
}
.box3d .f {
  position: absolute; width: 74px; height: 74px; left: 0; top: 0;
  background:
    linear-gradient(90deg, transparent 0 38%, var(--ribbon) 38% 62%, transparent 62% 100%),
    linear-gradient(0deg,  transparent 0 38%, var(--ribbon) 38% 62%, transparent 62% 100%),
    var(--boxcol);
  border: 1px solid rgba(0,0,0,.35);
}
.box3d .f-front  { transform: translateZ(37px); }
.box3d .f-back   { transform: rotateY(180deg) translateZ(37px); filter: brightness(.6); }
.box3d .f-right  { transform: rotateY(90deg)  translateZ(37px); filter: brightness(.78); }
.box3d .f-left   { transform: rotateY(-90deg) translateZ(37px); filter: brightness(.78); }
.box3d .f-top    { transform: rotateX(90deg)  translateZ(37px); filter: brightness(1.15); }
.box3d .f-bottom { transform: rotateX(-90deg) translateZ(37px); filter: brightness(.5); }

.target { --boxcol: var(--accent); --ribbon: #fff; }
.target.is-final { --boxcol: var(--primary); --ribbon: #fff; width: 150px; height: 150px; margin: -75px 0 0 -75px; }
.target.is-final .box3d { animation: spin3d 4.5s linear infinite, bob 1.8s ease-in-out infinite; }
.target.is-caught { animation: pop .4s ease forwards; pointer-events: none; }
/* cadeau encore trop loin : présent à l'image, mais pas attrapable */
.target.is-locked .f, .target.is-locked .pip { filter: grayscale(.5) brightness(.82); }

/* cadeaux lointains : repère léger plutôt qu'un volume complet (fluidité) */
.target.is-pip { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
.pip {
  position: absolute; inset: 22px; background: var(--primary);
  border: 2px solid rgba(0,0,0,.6); transform: rotate(45deg);
  animation: bob 3.2s ease-in-out infinite;
}
/* étiquette de distance : contre-mise à l'échelle pour rester lisible de loin */
.tag {
  position: absolute; left: 50%; top: 100%;
  transform: translateX(-50%) scale(var(--inv, 1));
  transform-origin: top center;
  background: #000; border: 1px solid rgba(255,255,255,.3);
  padding: 3px 7px; font-size: 11px; font-weight: 800; white-space: nowrap;
  color: #fff; pointer-events: none;
}
.cam-btn[disabled] { opacity: .45; cursor: not-allowed; }

@keyframes spin3d { from { transform: rotateX(-16deg) rotateY(0deg); }
                    to   { transform: rotateX(-16deg) rotateY(360deg); } }
@keyframes bob  { 0%,100% { translate: 0 -7px; } 50% { translate: 0 7px; } }
@keyframes pop  { to { transform: scale(2.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .box3d { animation: spin3d 18s linear infinite; }
}

/* ---------- HUD ---------- */
.hud { position: absolute; z-index: 5; pointer-events: none; }
.hud-top {
  top: max(14px, env(safe-area-inset-top)); left: 14px; right: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.pill {
  background: #000; border: 1px solid rgba(255,255,255,.35);
  padding: 9px 15px; font-weight: 800; font-size: .95rem;
  display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums;
}
.pill--timer.is-low { background: #c62828; border-color: #c62828; }
.dots { display: flex; gap: 6px; }
.dots i { width: 11px; height: 11px; background: rgba(255,255,255,.28); display: block; }
.dots i.on { background: var(--primary); }

.hud-bottom {
  bottom: max(18px, env(safe-area-inset-bottom)); left: 14px; right: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.hint {
  background: #000; border: 1px solid rgba(255,255,255,.3);
  padding: 10px 16px; font-size: .92rem; font-weight: 700; text-align: center;
  max-width: 94%;
}
/* Radar de proximité : ne montre pas où sont les cadeaux, seulement s'il chauffe */
.radar {
  position: relative; width: 100%; max-width: 300px; height: 12px;
  background: #000; border: 1px solid rgba(255,255,255,.3); overflow: hidden;
}
.radar b {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0%;
  background: var(--primary); transition: width .16s linear;
}
.hud-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.cam-btn {
  pointer-events: auto; background: var(--primary); color: var(--on-primary);
  border: 0; padding: 12px 18px; font-family: inherit; font-weight: 800; font-size: .95rem;
  cursor: pointer;
}
.cam-btn[hidden] { display: none; }
.cam-btn--ghost { background: rgba(0,0,0,.72); color: #fff; border: 1px solid rgba(255,255,255,.4); }

/* ---------- Résultat ---------- */
.prize-reveal { font-size: 82px; margin-bottom: 10px; animation: reveal .6s cubic-bezier(.2,1.3,.4,1) both; }
@keyframes reveal { from { transform: scale(0) rotate(-20deg); opacity: 0; } }
.prize-label {
  font-family: "Bricolage Grotesque", "Manrope", sans-serif;
  font-size: 1.7rem; font-weight: 800; color: var(--primary); margin-bottom: 8px; line-height: 1.15;
}

/* ---------- Formulaire ---------- */
.field { margin-bottom: 13px; text-align: left; }
.field label { display: block; font-size: .84rem; font-weight: 700; margin-bottom: 6px; color: rgba(255,255,255,.72); }
.field input {
  width: 100%; padding: 14px 15px; border-radius: 0; font-size: 1rem; font-family: inherit;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.25); color: #fff;
}
.field input:focus { outline: 2px solid var(--primary); outline-offset: 0; }

.task {
  display: flex; align-items: center; gap: 13px; text-align: left; width: 100%;
  padding: 15px; margin-bottom: 10px; border-radius: 0; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.2);
  color: #fff; font-family: inherit; font-size: 1rem; transition: background .15s;
}
.task .ico { font-size: 24px; flex: 0 0 26px; }
.task .txt { flex: 1; }
.task .txt b { display: block; font-size: .99rem; }
.task .txt small { color: rgba(255,255,255,.55); font-size: .8rem; }
.task .state {
  flex: 0 0 26px; height: 26px; display: grid; place-items: center;
  border: 2px solid rgba(255,255,255,.3); font-size: .8rem; font-weight: 800;
}
.task.done { background: rgba(34,197,94,.16); border-color: #22c55e; }
.task.done .state { background: #22c55e; border-color: #22c55e; color: #06210f; }

/* ---------- Bon ---------- */
.voucher {
  width: 100%; max-width: 400px; background: #fff; color: #111;
  padding: 24px; text-align: center; border: 3px solid var(--primary);
}
.voucher .code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 2.05rem; font-weight: 800;
  letter-spacing: .12em; margin: 12px 0; color: #111;
}
.voucher .sep { border: 0; border-top: 2px dashed #d0d0d0; margin: 16px 0; }
.voucher p { color: #555; font-size: .87rem; margin: 4px 0; }
.voucher .big { font-size: 1.2rem; font-weight: 800; color: #111; }

.footer-agency {
  margin-top: 22px; font-size: .72rem; color: rgba(255,255,255,.32); letter-spacing: .08em; text-align: center;
}
/* liens juridiques : discrets, mais toujours là */
.legal-liens { margin-top: 10px; font-size: .7rem; color: rgba(255,255,255,.28); text-align: center; line-height: 1.8 }
.legal-liens a { color: rgba(255,255,255,.5); text-decoration: none; padding: 2px 3px }
.legal-liens a:active, .legal-liens a:hover { color: #fff }
/* consentement à l'inscription */
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .82rem; line-height: 1.45; color: rgba(255,255,255,.72); margin: 12px 0 0; cursor: pointer }
.consent--opt { margin-bottom: 18px }
.consent input { flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--primary, #e2b24a) }
.consent a { color: #fff; text-decoration: underline; text-underline-offset: 2px }
.consent--opt { color: rgba(255,255,255,.55) }
/* mes données (compte) */
.acc-donnees { margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); text-align: left }
.acc-donnees h3 { margin: 0 0 8px; font-size: .95rem }
.acc-donnees .ligne { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.06); font-size: .86rem }
.acc-donnees .ligne:first-of-type { border-top: 0 }
.acc-donnees .ligne span { color: rgba(255,255,255,.7) }
.acc-donnees .mini { font-size: .8rem; padding: 8px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); background: transparent; color: #fff; cursor: pointer; white-space: nowrap; text-decoration: none }
.acc-donnees .mini--danger { border-color: rgba(255,90,60,.5); color: #ff8a70 }
.acc-donnees .switch { display: flex; gap: 8px; align-items: center; cursor: pointer }
.acc-donnees .switch input { width: 18px; height: 18px; accent-color: var(--primary, #e2b24a) }
.acc-donnees .note { font-size: .74rem; color: rgba(255,255,255,.4); margin: 8px 0 0 }

.toast {
  position: fixed; left: 50%; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: #000; border: 1px solid rgba(255,255,255,.35);
  padding: 12px 18px; font-size: .9rem; z-index: 1200;      /* au-dessus des onglets, du panneau et des fiches */
  opacity: 0; transition: opacity .25s; pointer-events: none; width: max-content; max-width: min(88vw, 420px); text-align: center;
  line-height: 1.4; box-shadow: 0 10px 30px -10px #000;
}
.toast.show { opacity: 1; }

/* ==========================================================================
   Boutons et surfaces arrondis — même allure que le site START GO
   ========================================================================== */
:root{ --r-pilule:999px; --r-panneau:18px; --r-champ:14px; }

.btn, .cam-btn, .seg-btn, .btn-sm{ border-radius:var(--r-pilule) }
.btn{
  position:relative; overflow:hidden;
  box-shadow:0 10px 24px -14px rgba(0,0,0,.9);
  transition:transform .22s ease, box-shadow .22s ease, filter .22s ease;
}
.btn:active{ transform:translateY(1px) }
.btn:focus-visible, .cam-btn:focus-visible{ outline:2px solid currentColor; outline-offset:3px }

.card, .panel, .box, .sheet, .ticket, .prize-card{ border-radius:var(--r-panneau) }
input, select, textarea{ border-radius:var(--r-champ) !important }
.av, .to, .co{ border-radius:14px }
.co{ border-radius:50% }
.badge, .badge-s, .pill, .gps-pill, .hud, .toast{ border-radius:var(--r-pilule) }
.avatar-preview{ border-radius:var(--r-panneau) }
.t-code{ border-radius:12px }

/* ==========================================================================
   RÉALITÉ AUGMENTÉE — habillage moderne
   Halo au sol, étiquette en verre, flèche de direction, jauge d'approche.
   ========================================================================== */

/* --- Halo posé au sol sous le cadeau : dit où il est, sans le masquer --- */
.target .halo{
  position:absolute; left:50%; top:74%; width:120%; height:34%;
  margin-left:-60%; border-radius:50%;
  border:2px solid rgba(255,255,255,.55);
  border:2px solid color-mix(in srgb, var(--primary) 70%, transparent);
  box-shadow:0 0 22px rgba(255,255,255,.28), inset 0 0 18px rgba(255,255,255,.14);
  box-shadow:0 0 22px color-mix(in srgb, var(--primary) 45%, transparent),
             inset 0 0 18px color-mix(in srgb, var(--primary) 22%, transparent);
  animation:halo-onde 2.6s ease-out infinite;
  pointer-events:none;
}
.target .halo--2{ animation-delay:1.3s }
@keyframes halo-onde{
  0%   { transform:scale(.55); opacity:0 }
  22%  { opacity:.95 }
  100% { transform:scale(1.35); opacity:0 }
}
.target.is-ready .halo{
  border-color:rgba(74,222,128,.85);
  box-shadow:0 0 26px rgba(34,197,94,.55), inset 0 0 20px rgba(34,197,94,.28);
  animation-duration:1.5s;
}
.target.is-locked .halo{ opacity:.55; animation-duration:3.4s }

/* --- Étiquette : pastille de verre, chiffres stables --- */
.tag{
  /* au-dessus du cadeau : le bandeau du bas ne peut plus la recouvrir */
  position:absolute; left:50%; top:auto; bottom:100%; margin-bottom:4px;
  transform:translateX(-50%) scale(var(--inv,1));
  transform-origin:bottom center;
  display:flex; flex-direction:column; align-items:center; gap:1px;
  padding:6px 13px 7px; border-radius:999px;
  background:rgba(10,12,18,.62);
  -webkit-backdrop-filter:blur(12px) saturate(1.4); backdrop-filter:blur(12px) saturate(1.4);
  border:1px solid rgba(255,255,255,.22);
  box-shadow:0 8px 26px rgba(0,0,0,.45);
  white-space:nowrap; pointer-events:none; color:#fff;
}
.tag .tag-d{ font-size:12.5px; font-weight:800; letter-spacing:.01em; font-variant-numeric:tabular-nums }
.tag .tag-n{
  font-style:normal; font-size:9.5px; font-weight:600; letter-spacing:.08em;
  text-transform:uppercase; color:rgba(255,255,255,.62);
  max-width:120px; overflow:hidden; text-overflow:ellipsis;
}
.target.is-ready .tag{ border-color:rgba(74,222,128,.6); box-shadow:0 8px 30px rgba(34,197,94,.35) }
.target.is-ready .tag .tag-d{ color:#8ef0b0 }
.target.is-pip .tag .tag-n{ display:none }

/* --- Flèche de bord d'écran : de quel côté se tourner --- */
.ar-guide{
  position:absolute; z-index:6; top:50%; transform:translateY(-50%);
  display:flex; flex-direction:column; align-items:center; gap:8px;
  pointer-events:none; animation:guide-entre .28s ease both;
}
.ar-guide[hidden]{ display:none }
.ar-guide.is-left{ left:14px }
.ar-guide.is-right{ right:14px }
@keyframes guide-entre{ from{ opacity:0; transform:translateY(-50%) scale(.9) } }

.ar-arrow{
  width:56px; height:56px; border-radius:50%;
  background:var(--primary);
  background:radial-gradient(circle at 50% 40%,
             color-mix(in srgb, var(--primary) 92%, #fff) 0%,
             color-mix(in srgb, var(--primary) 70%, #000) 100%);
  box-shadow:0 0 0 6px rgba(255,255,255,.14), 0 10px 30px rgba(0,0,0,.5);
  box-shadow:0 0 0 6px color-mix(in srgb, var(--primary) 18%, transparent),
             0 10px 30px rgba(0,0,0,.5);
  position:relative; animation:guide-pouls 1.4s ease-in-out infinite;
}
.ar-arrow::before{
  content:''; position:absolute; inset:0; margin:auto;
  width:0; height:0; border-style:solid;
}
.ar-guide.is-left  .ar-arrow::before{
  border-width:11px 15px 11px 0; border-color:transparent var(--on-primary) transparent transparent;
  margin-right:56%;
}
.ar-guide.is-right .ar-arrow::before{
  border-width:11px 0 11px 15px; border-color:transparent transparent transparent var(--on-primary);
  margin-left:56%;
}
.ar-guide.is-behind .ar-arrow{ animation-duration:.9s }
@keyframes guide-pouls{
  0%,100%{ transform:scale(1);    box-shadow:0 0 0 6px  color-mix(in srgb, var(--primary) 18%, transparent), 0 10px 30px rgba(0,0,0,.5) }
  50%    { transform:scale(1.08); box-shadow:0 0 0 16px color-mix(in srgb, var(--primary) 0%,  transparent), 0 10px 30px rgba(0,0,0,.5) }
}
.ar-guide-txt{
  display:flex; flex-direction:column; align-items:center; gap:1px;
  padding:7px 13px; border-radius:999px; max-width:44vw; text-align:center;
  background:rgba(10,12,18,.62);
  -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
  border:1px solid rgba(255,255,255,.2);
}
.ar-guide-txt b{ font-size:.8rem; font-weight:800; white-space:nowrap }
.ar-guide-txt span{
  font-size:.68rem; color:rgba(255,255,255,.6); font-weight:600;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:40vw;
}

/* --- Cadre de visée discret : donne le ton « appareil de détection » --- */
.ar-scan{ position:absolute; inset:0; z-index:2; pointer-events:none }
.ar-scan i{
  position:absolute; left:26px; right:26px; height:34vh;
  top:50%; transform:translateY(-50%);
  border-left:2px solid rgba(255,255,255,.14); border-right:2px solid rgba(255,255,255,.14);
  border-radius:26px;
}
.ar-scan i:last-child{
  left:38px; right:38px; height:24vh; opacity:.5;
  border-left-color:rgba(255,255,255,.22);
  border-left-color:color-mix(in srgb, var(--primary) 45%, transparent);
  border-right-color:rgba(255,255,255,.22);
  border-right-color:color-mix(in srgb, var(--primary) 45%, transparent);
}

/* --- Bandeau d'indication et jauge d'approche --- */
.hint{
  background:rgba(10,12,18,.6); border:1px solid rgba(255,255,255,.18);
  -webkit-backdrop-filter:blur(14px) saturate(1.3); backdrop-filter:blur(14px) saturate(1.3);
  border-radius:999px; padding:11px 20px; font-size:.9rem; font-weight:700;
  text-align:center; max-width:94%; box-shadow:0 10px 30px rgba(0,0,0,.35);
}
.radar-bar, .radar{
  position:relative; width:100%; max-width:300px; height:10px;
  background:rgba(255,255,255,.09); border:1px solid rgba(255,255,255,.14);
  border-radius:999px; overflow:hidden;
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
}
.radar-bar b, .radar b{
  position:absolute; left:0; top:0; bottom:0; width:0%; border-radius:999px;
  background:var(--primary);
  background:linear-gradient(90deg,
    color-mix(in srgb, var(--primary) 55%, transparent),
    var(--primary) 60%, #fff 100%);
  box-shadow:0 0 14px rgba(255,255,255,.35);
  box-shadow:0 0 14px color-mix(in srgb, var(--primary) 60%, transparent);
  transition:width .18s cubic-bezier(.4,0,.2,1);
}
.radar-bar.is-hot b{
  background:linear-gradient(90deg, rgba(34,197,94,.5), #22c55e 60%, #d1fae5 100%);
  box-shadow:0 0 18px rgba(34,197,94,.75);
}
.radar-bar.is-hot{ border-color:rgba(74,222,128,.5) }

/* --- Boutons caméra : pastilles, pas des rectangles --- */
.cam-btn{
  border-radius:999px; padding:13px 22px; letter-spacing:.01em;
  box-shadow:0 10px 26px rgba(0,0,0,.35);
  transition:transform .14s ease, box-shadow .14s ease, opacity .14s ease;
}
.cam-btn:active{ transform:translateY(1px) scale(.98) }
.cam-btn--ghost{
  background:rgba(10,12,18,.6); border:1px solid rgba(255,255,255,.24);
  -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
}
.pill{
  border-radius:999px; background:rgba(10,12,18,.6);
  -webkit-backdrop-filter:blur(12px) saturate(1.3); backdrop-filter:blur(12px) saturate(1.3);
  border:1px solid rgba(255,255,255,.2); box-shadow:0 8px 24px rgba(0,0,0,.3);
}

@media (prefers-reduced-motion: reduce){
  .target .halo, .ar-arrow{ animation:none }
}

/* --- Raretés du cadeau en réalité augmentée : le volume change de couleur --- */
.target.r-rare{ --boxcol:#4d8de0; --ribbon:#eaf3ff }
.target.r-dore{ --boxcol:#e8b93a; --ribbon:#fffaf0 }
.target.r-rare .halo{
  border-color:rgba(107,167,255,.8);
  box-shadow:0 0 24px rgba(107,167,255,.45), inset 0 0 18px rgba(107,167,255,.2);
}
.target.r-dore .halo{
  border-color:rgba(245,197,66,.9);
  box-shadow:0 0 30px rgba(245,197,66,.6), inset 0 0 22px rgba(245,197,66,.28);
  animation-duration:1.8s;
}
.target.r-dore .box3d{ filter:drop-shadow(0 0 16px rgba(245,197,66,.55)) }
.target.est-du-jour .tag{ border-color:rgba(245,197,66,.7) }
.target.est-du-jour .tag .tag-n::before{ content:'★ ' }

/* l'écran de résultat prend la couleur de ce qu'on vient de trouver */
#screen-reveal.r-dore .prize-label{ color:#f5c542 }
#screen-reveal.r-rare .prize-label{ color:#6ba7ff }

/* ==========================================================================
   ═══ SYSTÈME GRAPHIQUE FUTURISTE ═══
   Même palette : --primary, --accent et --bg restent ceux du restaurant.
   Le futurisme vient de la lumière, du verre et du mouvement, jamais de
   couleurs nouvelles. Tout ce qui suit est bâti sur ces trois variables.
   ========================================================================== */
:root{
  /* déclinaisons calculées une seule fois, réutilisées partout */
  --lueur:        color-mix(in srgb, var(--primary) 55%, transparent);
  --lueur-forte:  color-mix(in srgb, var(--primary) 85%, transparent);
  --voile:        color-mix(in srgb, var(--primary) 12%, transparent);
  --verre:        rgba(14,17,24,.62);
  --verre-haut:   rgba(255,255,255,.10);
  --trait:        rgba(255,255,255,.14);
  --r-pilule:999px; --r-panneau:20px; --r-champ:16px;
  --sortie: cubic-bezier(.16,1,.3,1);
}

/* --- Fond : une grille de perspective qui dérive lentement -----------------
   Elle est portée par #app et non par body : les écrans ont un fond opaque
   qui la masquerait complètement. */
#app::before{
  content:''; position:absolute; inset:-20% -20% -40% -20%; z-index:0; pointer-events:none;
  background:
    linear-gradient(var(--trait) 1px, transparent 1px) 0 0/100% 46px,
    linear-gradient(90deg, var(--trait) 1px, transparent 1px) 0 0/46px 100%;
  opacity:.16;
  transform:perspective(600px) rotateX(58deg);
  transform-origin:50% 0;
  animation:grille-derive 18s linear infinite;
}
#app::after{                       /* halo diffus au-dessus de la scène */
  content:''; position:absolute; inset:0; z-index:0; pointer-events:none;
  background:radial-gradient(120% 70% at 50% -10%, var(--voile), transparent 60%);
}
/* les écrans laissent voir le décor ; seuls ceux qui doivent rester opaques
   gardent leur fond (la caméra, le repli sans caméra) */
.screen{ background:transparent; position:absolute; z-index:1 }
#screen-hunt{ background:#000 }
#screen-hunt.nocam{ background:#15171c }
@keyframes grille-derive{ to{ background-position:0 46px, 46px 0 } }

/* --- Boutons : verre, liseré lumineux, balayage au toucher ---------------- */
.btn, .cam-btn, .btn-sm{
  position:relative; overflow:hidden; isolation:isolate;
  border-radius:var(--r-pilule);
  letter-spacing:.015em;
  transition:transform .18s var(--sortie), box-shadow .18s var(--sortie), filter .18s ease;
}
.btn{
  padding:15px 26px; font-weight:800; border:0;
  background:linear-gradient(135deg,
    color-mix(in srgb, var(--primary) 100%, #fff 0%),
    color-mix(in srgb, var(--primary) 78%, #000));
  color:var(--on-primary);
  box-shadow:0 0 0 1px var(--lueur-forte),
             0 10px 30px -8px var(--lueur),
             inset 0 1px 0 rgba(255,255,255,.45);
}
.btn::before{                       /* le balayage lumineux */
  content:''; position:absolute; inset:0; z-index:-1;
  background:linear-gradient(105deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform:translateX(-130%);
  transition:transform .7s var(--sortie);
}
.btn:hover::before, .btn:focus-visible::before{ transform:translateX(130%) }
.btn:active{ transform:translateY(1px) scale(.985) }
.btn[disabled]{ filter:grayscale(.55) brightness(.75); box-shadow:none }

.btn--ghost{
  background:var(--verre); color:#fff;
  -webkit-backdrop-filter:blur(14px) saturate(1.3); backdrop-filter:blur(14px) saturate(1.3);
  box-shadow:inset 0 0 0 1px var(--trait), 0 8px 24px -10px #000;
}
.btn--ghost:hover{ box-shadow:inset 0 0 0 1px var(--lueur-forte), 0 8px 26px -8px var(--lueur) }

/* --- Champs de saisie ---------------------------------------------------- */
.field input, .field select, input[type=text], input[type=email], input[type=password]{
  border-radius:var(--r-champ);
  background:rgba(255,255,255,.045);
  border:1px solid var(--trait);
  transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.field input:focus, input[type=text]:focus, input[type=email]:focus, input[type=password]:focus{
  outline:none;
  border-color:var(--lueur-forte);
  background:rgba(255,255,255,.07);
  box-shadow:0 0 0 3px var(--voile), 0 0 22px -6px var(--lueur);
}

/* --- Panneaux de verre --------------------------------------------------- */
.card, .voucher, .reveal-card, .claim-card{
  position:relative; border-radius:var(--r-panneau);
  background:linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.028));
  border:1px solid var(--trait);
  -webkit-backdrop-filter:blur(18px) saturate(1.25); backdrop-filter:blur(18px) saturate(1.25);
  box-shadow:0 20px 50px -24px #000;
}
.card::after{                       /* le filet lumineux du haut */
  content:''; position:absolute; left:16%; right:16%; top:0; height:1px; pointer-events:none;
  background:linear-gradient(90deg, transparent, var(--lueur-forte), transparent);
}

/* --- Segments de navigation ---------------------------------------------- */
.seg{
  border-radius:var(--r-pilule); padding:4px; gap:4px; border:1px solid var(--trait);
  background:rgba(255,255,255,.05);
}
.seg-btn{ border-radius:var(--r-pilule); transition:all .2s var(--sortie) }
.seg-btn.is-on{
  box-shadow:0 0 0 1px var(--lueur-forte), 0 6px 18px -8px var(--lueur);
}

/* --- Arrivée des écrans -------------------------------------------------- */
.screen.is-active{ animation:ecran-entre .42s var(--sortie) both }
@keyframes ecran-entre{ from{ opacity:0; transform:translateY(14px) scale(.985) } }

/* le contenu se pose en cascade, pas d'un bloc */
.screen.is-active > *{ animation:pose .5s var(--sortie) both }
.screen.is-active > *:nth-child(1){ animation-delay:.03s }
.screen.is-active > *:nth-child(2){ animation-delay:.07s }
.screen.is-active > *:nth-child(3){ animation-delay:.11s }
.screen.is-active > *:nth-child(4){ animation-delay:.15s }
.screen.is-active > *:nth-child(n+5){ animation-delay:.19s }
.screen--flat.is-active > *{ animation:none }      /* la carte ne bouge pas */
@keyframes pose{ from{ opacity:0; transform:translateY(10px) } }

/* --- Titres -------------------------------------------------------------- */
h1{ letter-spacing:-.03em }
.brand-name{
  position:relative; display:inline-block; padding-bottom:8px;
}
.brand-name::after{
  content:''; position:absolute; left:0; right:0; bottom:0; height:1px;
  background:linear-gradient(90deg, transparent, var(--lueur-forte), transparent);
}

/* --- Le lot gagné : il arrive comme une projection ------------------------ */
.prize-reveal{
  animation:reveal .6s cubic-bezier(.2,1.3,.4,1) both, flotte 3.4s ease-in-out 0.6s infinite;
  filter:drop-shadow(0 0 26px var(--lueur));
}
@keyframes flotte{ 0%,100%{ translate:0 -5px } 50%{ translate:0 5px } }
.prize-label{
  text-shadow:0 0 30px var(--lueur);
}

/* --- Barre d'onglets ----------------------------------------------------- */
.tabbar{
  background:rgba(12,14,20,.82);
  -webkit-backdrop-filter:blur(20px) saturate(1.3); backdrop-filter:blur(20px) saturate(1.3);
  border-top:1px solid var(--trait);
}
.tab{ position:relative; transition:color .2s ease }
.tab span{ transition:transform .25s var(--sortie) }
.tab.is-on span{ transform:translateY(-2px) scale(1.12) }
.tab.is-on::before{
  content:''; position:absolute; top:0; left:50%; width:30px; height:2px; margin-left:-15px;
  background:var(--primary); border-radius:999px;
  box-shadow:0 0 14px 1px var(--lueur-forte);
  animation:onglet-arrive .3s var(--sortie) both;
}
@keyframes onglet-arrive{ from{ width:0; margin-left:0 } }

@media (prefers-reduced-motion: reduce){
  body::before{ animation:none }
  .screen.is-active, .screen.is-active > *, .prize-reveal, .tab.is-on::before{ animation:none }
  .btn::before{ transition:none }
}

/* --- Le viseur de la chasse : un vrai HUD -------------------------------- */
.ar-scan i{
  border:0; border-radius:0;
  left:24px; right:24px; height:32vh; top:44%;   /* dégage le bandeau du bas */
}
.ar-scan i:first-child::before, .ar-scan i:first-child::after,
.ar-scan i:last-child::before,  .ar-scan i:last-child::after{
  content:''; position:absolute; width:30px; height:30px;
  border:2px solid var(--lueur-forte); opacity:.75;
}
.ar-scan i:first-child::before{ left:0;  top:0;    border-right:0; border-bottom:0; border-radius:6px 0 0 0 }
.ar-scan i:first-child::after { right:0; top:0;    border-left:0;  border-bottom:0; border-radius:0 6px 0 0 }
.ar-scan i:last-child{ left:24px; right:24px; height:32vh; top:44%; opacity:1 }
.ar-scan i:last-child::before{ left:0;  bottom:0; border-right:0; border-top:0; border-radius:0 0 0 6px }
.ar-scan i:last-child::after { right:0; bottom:0; border-left:0;  border-top:0; border-radius:0 0 6px 0 }

/* la ligne de balayage qui descend dans le cadre */
#hunt-layer::after{
  content:''; position:absolute; left:26px; right:26px; height:2px; top:28%;
  background:linear-gradient(90deg, transparent, var(--primary), transparent);
  box-shadow:0 0 18px 2px var(--lueur);
  opacity:.5; pointer-events:none;
  animation:scan-descend 3.6s ease-in-out infinite;
}
@keyframes scan-descend{
  0%,100%{ transform:translateY(0);    opacity:.18 }
  50%    { transform:translateY(30vh); opacity:.6 }
}

/* --- Studio du personnage : mêmes codes que le reste --------------------- */
.avatar-preview, .acc-avatar{
  border-radius:4px 18px 4px 18px;
  background:radial-gradient(120% 90% at 50% 10%, rgba(255,255,255,.09), rgba(255,255,255,.02));
  border:1px solid var(--trait);
  box-shadow:inset 0 0 30px -12px var(--lueur);
}
.chooser .av{
  border-radius:var(--r-pilule); border:1px solid var(--trait);
  background:rgba(255,255,255,.045);
  transition:all .18s var(--sortie);
}
.chooser .av.is-on{
  background:var(--voile); border-color:var(--lueur-forte);
  box-shadow:0 0 18px -6px var(--lueur);
}
.chooser.tones .to, .color-pick .co{
  border-radius:50%; border:2px solid transparent;
  transition:transform .16s var(--sortie), box-shadow .16s ease;
}
.chooser.tones .to.is-on, .color-pick .co.is-on{
  transform:scale(1.14);
  border-color:#fff;
  box-shadow:0 0 0 3px rgba(255,255,255,.14), 0 0 18px -2px currentColor;
}

@media (prefers-reduced-motion: reduce){ #hunt-layer::after{ animation:none } }

/* ==========================================================================
   ═══ ÉCRAN D'ACCUEIL ═══
   C'est le premier écran après le scan du QR code, et il s'adresse à des
   ados. Trois secondes pour comprendre et avoir envie : un personnage en
   grand qui bouge, ce qu'on peut gagner, trois étapes, un gros bouton.
   ========================================================================== */
/* Un élément masqué doit l'être quoi qu'il arrive : plusieurs classes de mise
   en page posent un display qui écrase l'attribut hidden. */
[hidden]{ display:none !important }

.hero{
  display:flex; flex-direction:column; align-items:center;
  width:100%; max-width:460px; gap:0;
}
.hero-marque{ margin-bottom:2px }
.hero-marque .logo{ max-height:84px; margin:0 }

/* --- la scène : le personnage sur un projecteur ------------------------- */
.hero-scene{
  position:relative; width:100%; height:min(31vh, 224px);
  display:grid; place-items:end center; margin:4px 0 2px;
}
.hero-scene::before{                 /* faisceau de lumière venu du haut */
  content:''; position:absolute; left:50%; top:-4%; width:78%; height:104%;
  transform:translateX(-50%);
  background:linear-gradient(180deg, var(--voile), transparent 72%);
  clip-path:polygon(34% 0, 66% 0, 100% 100%, 0 100%);
  pointer-events:none;
}
.hero-avatar{ position:relative; z-index:1; width:100%; height:100%; display:block }
.hero-sol{                           /* le disque au sol, qui respire */
  position:absolute; left:50%; bottom:2px; width:190px; height:44px;
  margin-left:-95px; border-radius:50%;
  border:1px solid var(--lueur-forte);
  background:radial-gradient(ellipse at center, var(--voile), transparent 70%);
  box-shadow:0 0 44px -6px var(--lueur);
  animation:sol-respire 3.2s ease-in-out infinite;
}
@keyframes sol-respire{
  0%,100%{ transform:scale(1);    opacity:.75 }
  50%    { transform:scale(1.09); opacity:1 }
}

/* --- le titre ----------------------------------------------------------- */
.hero-titre{
  font-size:clamp(1.7rem, 7.4vw, 2.3rem); line-height:1.06; margin:10px 0 12px;
  letter-spacing:-.035em; text-align:center; text-wrap:balance;
}
.hero-titre em{
  font-style:normal; display:inline-block; position:relative;
  color:var(--primary); text-shadow:0 0 34px var(--lueur);
}
.hero-titre em::after{
  content:''; position:absolute; left:-2%; right:-2%; bottom:2px; height:5px;
  border-radius:999px; background:var(--primary); opacity:.22;
}

/* --- ce qu'il y a à gagner ---------------------------------------------- */
.hero-lots{ display:flex; flex-wrap:wrap; gap:7px; justify-content:center; margin-bottom:14px }
.lot-chip{
  display:inline-flex; align-items:center; gap:7px;
  padding:7px 13px 7px 8px; border-radius:999px;
  background:rgba(255,255,255,.06); border:1px solid var(--trait);
  font-size:.8rem; font-weight:700;
  animation:chip-arrive .5s var(--sortie) both;
}
.lot-chip i{ font-style:normal; font-size:15px; line-height:1 }
.hero-lots .lot-chip:nth-child(2){ animation-delay:.08s }
.hero-lots .lot-chip:nth-child(3){ animation-delay:.16s }
@keyframes chip-arrive{ from{ opacity:0; transform:translateY(8px) scale(.94) } }

/* --- les trois étapes ---------------------------------------------------- */
.hero-etapes{
  display:flex; gap:6px; width:100%; margin-bottom:18px;
}
.etape{
  flex:1; display:flex; flex-direction:column; align-items:center; gap:5px;
  padding:11px 6px; border-radius:4px 14px 4px 14px; text-align:center;
  background:rgba(255,255,255,.035); border:1px solid var(--trait);
  font-size:.71rem; line-height:1.25; color:rgba(255,255,255,.72); font-weight:600;
}
.etape b{
  width:22px; height:22px; display:grid; place-items:center; border-radius:50%;
  background:var(--primary); color:var(--on-primary); font-size:.72rem;
}

/* --- le bouton : le plus gros élément de l'écran ------------------------- */
.btn--jouer{
  width:100%; display:flex; align-items:center; justify-content:center; gap:12px;
  font-size:1.18rem; letter-spacing:.09em; padding:18px 26px;
  animation:jouer-pouls 2.4s ease-in-out infinite;
}
.btn--jouer i{ font-style:normal; font-size:1rem; transition:transform .2s var(--sortie) }
.btn--jouer:active i{ transform:translateX(4px) }
@keyframes jouer-pouls{
  0%,100%{ box-shadow:0 0 0 1px var(--lueur-forte), 0 10px 30px -8px var(--lueur),
                      0 0 0 0 var(--lueur), inset 0 1px 0 rgba(255,255,255,.45) }
  55%    { box-shadow:0 0 0 1px var(--lueur-forte), 0 10px 30px -8px var(--lueur),
                      0 0 0 16px transparent, inset 0 1px 0 rgba(255,255,255,.45) }
}
#lien-connexion{ margin-top:12px; font-size:.9rem }
.hero-gratuit{
  margin:12px 0 0; font-size:.72rem; color:rgba(255,255,255,.38);
  letter-spacing:.04em; text-align:center;
}

/* --- l'arrivée du formulaire -------------------------------------------- */
#auth-bloc.arrive{ animation:pose .42s var(--sortie) both }
#lien-retour{ margin-top:4px }

/* --- écrans courts : on comprime la scène plutôt que de couper le bouton - */
@media (max-height: 740px){
  .hero-scene{ height:min(26vh, 168px) }
  .hero-titre{ font-size:clamp(1.4rem, 6.4vw, 1.8rem); margin:6px 0 8px }
  .hero-lots{ margin-bottom:10px }
  .hero-etapes{ margin-bottom:12px }
  .btn--jouer{ padding:15px 22px; font-size:1.05rem }
}
@media (prefers-reduced-motion: reduce){
  .hero-sol, .btn--jouer, .lot-chip{ animation:none }
}
.task--info{ cursor:default; border-style:dashed; opacity:.9 }
.task--info .state{ color:rgba(255,255,255,.5) }
/* --- la marque du jeu sur l'accueil ---------------------------------------- */
.hero-marque .logo--jeu{ max-height:190px; max-width:92%; filter:drop-shadow(0 0 26px rgba(226,178,74,.35)) }
.brand-name--sous{ font-size:.9rem; color:rgba(255,255,255,.6); margin-top:4px; letter-spacing:.04em }
.hero-jeuzon{ display:flex; align-items:center; gap:8px; margin-top:14px; opacity:.75 }
.hero-jeuzon span{ font-size:.72rem; letter-spacing:.12em; text-transform:uppercase; color:rgba(255,255,255,.5) }
.hero-jeuzon img{ height:66px; width:auto }
