/* Ticket Gagnant : section vitrine de la page Systèmes & agents.
   Illustrations 3D des jeux : Microsoft Fluent Emoji (licence MIT), reprises de l'appli. */

.chip3d img{width:22px;height:22px;margin:-3px 0}

/* ---------- scène sombre, aux couleurs de l'appli ---------- */
.tg-stage{
  --night:#15122B; --gold:#FFC94D; --cream:#FFF6E6;
  position:relative;overflow:hidden;isolation:isolate;
  display:grid;grid-template-columns:auto minmax(0,1fr);gap:clamp(28px,4vw,64px);align-items:center;
  padding:clamp(28px,5vw,64px);border-radius:40px;
  background:linear-gradient(160deg,#211B44 0%,#15122B 55%,#0F0D20 100%);
  color:#FBF5EC;box-shadow:var(--sh-3)
}
.tg-stars,.tg-glow{position:absolute;inset:0;z-index:-1;pointer-events:none}
.tg-stars{
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%,rgba(255,255,255,.9),transparent),
    radial-gradient(1px 1px at 28% 72%,rgba(255,255,255,.7),transparent),
    radial-gradient(1.6px 1.6px at 44% 12%,rgba(255,255,255,.8),transparent),
    radial-gradient(1px 1px at 63% 84%,rgba(255,255,255,.6),transparent),
    radial-gradient(1.3px 1.3px at 78% 22%,rgba(255,255,255,.85),transparent),
    radial-gradient(1px 1px at 91% 64%,rgba(255,255,255,.7),transparent),
    radial-gradient(1.2px 1.2px at 6% 88%,rgba(255,255,255,.6),transparent),
    radial-gradient(1px 1px at 52% 46%,rgba(255,255,255,.5),transparent);
  background-size:420px 380px;animation:tgTwinkle 6s ease-in-out infinite alternate
}
@keyframes tgTwinkle{to{opacity:.55}}
.tg-glow i{position:absolute;border-radius:50%;filter:blur(10px)}
.tg-glow i:nth-child(1){left:-12%;top:-30%;width:620px;height:620px;background:radial-gradient(closest-side,rgba(157,128,224,.38),transparent)}
.tg-glow i:nth-child(2){right:-14%;bottom:-40%;width:680px;height:680px;background:radial-gradient(closest-side,rgba(246,180,140,.26),transparent)}
.tg-glow i:nth-child(3){left:30%;top:20%;width:420px;height:420px;background:radial-gradient(closest-side,rgba(255,201,77,.14),transparent)}

/* ---------- ticket de caisse + téléphone ---------- */
.tg-visual{position:relative;display:flex;align-items:center;gap:clamp(18px,3vw,44px)}
.tg-receipt-col{--fx:210px;--fy:-70px;position:relative;width:208px;flex:none}
.tg-printer{position:relative;z-index:2;height:34px;margin:0 -12px;border-radius:14px 14px 10px 10px;background:linear-gradient(180deg,#3B3558,#26213F);box-shadow:inset 0 1px 0 rgba(255,255,255,.14),0 12px 20px -10px rgba(0,0,0,.6)}
.tg-printer::before{content:"";position:absolute;left:12px;top:12px;width:8px;height:8px;border-radius:50%;background:#7EE2A4;box-shadow:0 0 10px #7EE2A4}
.tg-printer::after{content:"";position:absolute;left:10px;right:10px;bottom:5px;height:5px;border-radius:3px;background:#0B0918}
.tg-paper{position:relative;margin-top:-6px;overflow:hidden;padding:0 6px 26px}
.tg-receipt{
  position:relative;padding:22px 16px 26px;background:#FFFDF8;color:#2B2735;
  font:500 12px/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  transform:translateY(-102%);box-shadow:0 18px 30px -16px rgba(0,0,0,.6);
  -webkit-mask:conic-gradient(from -45deg at bottom,#0000,#000 1deg 89deg,#0000 90deg) 50%/14px 100%;
          mask:conic-gradient(from -45deg at bottom,#0000,#000 1deg 89deg,#0000 90deg) 50%/14px 100%
}
.tg-receipt b{display:block;text-align:center;font-weight:800;font-size:13px;letter-spacing:.14em}
.tg-receipt .tg-date{display:block;width:max-content;margin:6px auto 12px;padding:1px 8px;border:1.5px dashed #D9443A;border-radius:6px;color:#D9443A;font-weight:700}
.tg-receipt ul{list-style:none;margin:0;padding:10px 0;border-block:1.5px dashed #CFC8BC}
.tg-receipt li,.tg-total{display:flex;justify-content:space-between;gap:8px}
.tg-total{padding-top:9px;font-weight:800;font-size:13.5px}
.tg-merci{margin:10px 0 0;text-align:center;font-size:11px;color:#8A8392}
.tg-code{display:flex;justify-content:center;gap:2px;height:26px;margin-top:10px}
.tg-code i{width:var(--w,2px);background:#2B2735}
/* faisceau de lecture */
.tg-beam{position:absolute;left:-6px;right:-6px;top:0;height:3px;border-radius:3px;background:var(--gold);box-shadow:0 0 14px 4px rgba(255,201,77,.7),0 0 46px 12px rgba(255,201,77,.25);opacity:0}
.tg-frame{position:absolute;inset:6px -2px 18px;opacity:0;pointer-events:none;
  background:
    linear-gradient(var(--gold),var(--gold)) top left/22px 3px,linear-gradient(var(--gold),var(--gold)) top left/3px 22px,
    linear-gradient(var(--gold),var(--gold)) top right/22px 3px,linear-gradient(var(--gold),var(--gold)) top right/3px 22px,
    linear-gradient(var(--gold),var(--gold)) bottom left/22px 3px,linear-gradient(var(--gold),var(--gold)) bottom left/3px 22px,
    linear-gradient(var(--gold),var(--gold)) bottom right/22px 3px,linear-gradient(var(--gold),var(--gold)) bottom right/3px 22px;
  background-repeat:no-repeat}
.tg-ok{position:absolute;left:50%;top:44%;z-index:3;display:flex;align-items:center;gap:6px;padding:8px 14px 8px 10px;border-radius:999px;background:#2F9466;color:#fff;font:700 14px/1 var(--fb);white-space:nowrap;box-shadow:0 10px 24px -8px rgba(0,0,0,.6);transform:translate(-50%,-50%) scale(.4);opacity:0}
.tg-ok svg{width:18px;height:18px}
.tg-coins{position:absolute;left:50%;top:44%;z-index:4;pointer-events:none}
.tg-coins img{position:absolute;left:-20px;top:-20px;width:40px;height:40px;max-width:none;opacity:0;filter:drop-shadow(0 6px 8px rgba(0,0,0,.45))}

/* boucle : impression, lecture, validation, pièces envoyées au téléphone */
.tg-stage.play .tg-receipt{animation:tgPrint 7.5s var(--ease) infinite}
.tg-stage.play .tg-beam{animation:tgBeam 7.5s linear infinite}
.tg-stage.play .tg-frame{animation:tgFrame 7.5s ease infinite}
.tg-stage.play .tg-ok{animation:tgOk 7.5s var(--spring) infinite}
.tg-stage.play .tg-coins img{animation:tgCoin 7.5s var(--ease) infinite}
.tg-stage.play .tg-coins img:nth-child(2){animation-delay:.12s}
.tg-stage.play .tg-coins img:nth-child(3){animation-delay:.24s}
@keyframes tgPrint{
  0%{transform:translateY(-102%)} 20%{transform:translateY(0)}
  86%{transform:translateY(0);opacity:1} 94%{transform:translateY(14%) rotate(-3deg);opacity:0} 100%{transform:translateY(-102%);opacity:0}
}
@keyframes tgFrame{0%,22%{opacity:0;transform:scale(1.08)} 27%,52%{opacity:1;transform:none} 58%,100%{opacity:0}}
@keyframes tgBeam{0%,27%{opacity:0;top:2%} 29%{opacity:1;top:2%} 48%{opacity:1;top:88%} 50%,100%{opacity:0;top:88%}}
@keyframes tgOk{0%,50%{opacity:0;transform:translate(-50%,-50%) scale(.4)} 55%,64%{opacity:1;transform:translate(-50%,-50%) scale(1)} 70%,100%{opacity:0;transform:translate(-50%,-50%) scale(.9)}}
@keyframes tgCoin{
  0%,62%{opacity:0;transform:translate(0,0) scale(.3)}
  66%{opacity:1;transform:translate(0,-34px) scale(1.1)}
  80%{opacity:1;transform:translate(calc(var(--fx) * .6),calc(var(--fy) - 70px)) scale(.9)}
  88%{opacity:0;transform:translate(var(--fx),var(--fy)) scale(.5)}
  100%{opacity:0}
}

/* téléphone */
.tg-phone-wrap{position:relative;flex:none}
.tg-phone{
  position:relative;height:min(580px,calc(100svh - 180px));min-height:420px;aspect-ratio:9/19.5;
  border-radius:48px;padding:10px;background:linear-gradient(150deg,#4A4363,#1D1A27 62%);
  box-shadow:inset 0 0 0 1.5px rgba(255,255,255,.18),inset 0 2px 1px rgba(255,255,255,.14),inset 0 0 0 4px #15131C,0 40px 80px -30px rgba(0,0,0,.8),0 0 0 1px rgba(255,255,255,.04);
  transform:perspective(1200px) rotateX(var(--rx,3deg)) rotateY(var(--ry,-9deg));transition:transform .45s var(--ease)
}
.tg-phone::before{content:"";position:absolute;z-index:3;top:19px;left:50%;width:30%;height:21px;transform:translateX(-50%);border-radius:999px;background:#0E0D13}
.tg-screen{position:relative;height:100%;border-radius:38px;overflow:hidden;background:#0D0F22;isolation:isolate}
.tg-screen .sb{background:linear-gradient(#0D0F22 60%,rgba(13,15,34,0))}
.tg-screen img{position:absolute;left:0;top:34px;width:100%;height:calc(100% - 34px);object-fit:cover;object-position:top center;opacity:0;transform:translateY(5%) scale(.98);transition:opacity .45s ease,transform .7s var(--ease)}
.tg-screen img.on{opacity:1;transform:none}
.tg-screen img.out{opacity:0;transform:translateY(-3%) scale(.98)}
.tg-screen .home-ind{z-index:3}

.tg-fl{max-width:none;position:absolute;z-index:4;width:var(--s,58px);height:var(--s,58px);pointer-events:none;filter:drop-shadow(0 12px 14px rgba(0,0,0,.45));animation:tgBob var(--t,6s) ease-in-out infinite;animation-delay:var(--dl,0s)}
@keyframes tgBob{0%,100%{transform:translateY(0) rotate(var(--r,0deg))}50%{transform:translateY(-12px) rotate(calc(var(--r,0deg) * -1))}}
.tg-fl.f1{--s:64px;--r:-8deg;right:-30px;top:8%}
.tg-fl.f2{--s:48px;--r:10deg;--t:7s;--dl:-2s;left:-26px;top:30%}
.tg-fl.f3{--s:54px;--r:-6deg;--t:5.6s;--dl:-1s;right:-24px;bottom:16%}
.tg-fl.f4{--s:44px;--r:12deg;--t:6.6s;--dl:-3s;left:-18px;bottom:6%}

/* ---------- étapes, liées à l'écran ---------- */
.tg-side{min-width:0}
.tg-side h3{font-size:clamp(22px,2.2vw,28px);letter-spacing:-.02em;margin:0 0 6px;color:#fff}
.tg-side > p{margin:0 0 20px;color:rgba(251,245,236,.68);font-size:15.5px}
.tg-steps{list-style:none;margin:0;padding:0;display:grid;gap:8px;counter-reset:tg}
.tg-steps button{
  position:relative;overflow:hidden;width:100%;display:flex;gap:14px;align-items:center;text-align:left;
  padding:12px 16px 12px 12px;border:0;border-radius:20px;cursor:pointer;
  background:rgba(255,255,255,.055);color:inherit;font:inherit;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.07);
  transition:background .35s,box-shadow .35s,transform .5s var(--spring);-webkit-tap-highlight-color:transparent
}
.tg-steps button:hover{background:rgba(255,255,255,.09)}
.tg-steps button[aria-selected=true]{background:var(--cream);color:var(--ink);box-shadow:0 14px 30px -14px rgba(0,0,0,.6);transform:translateX(6px)}
.tg-steps img{flex:none;width:42px;height:42px;padding:6px;border-radius:14px;background:rgba(255,255,255,.08);transition:transform .5s var(--spring),background .35s}
.tg-steps button[aria-selected=true] img{background:#FFE7A6;transform:rotate(-8deg) scale(1.06)}
.tg-steps b{display:block;font-weight:700;font-size:16px;line-height:1.3}
.tg-steps small{display:block;font-size:14px;line-height:1.45;color:rgba(251,245,236,.6);max-height:0;opacity:0;overflow:hidden;transition:max-height .5s var(--ease),opacity .35s,margin .35s}
.tg-steps button[aria-selected=true] small{max-height:6em;opacity:1;margin-top:3px;color:var(--ink-2)}
.tg-bar{position:absolute;left:0;bottom:0;height:3px;width:0;background:linear-gradient(90deg,#FFC94D,#F2994B)}
.tg-steps button[aria-selected=true] .tg-bar{animation:tgBar var(--dur,4800ms) linear forwards}
.tg-stage.hold .tg-bar,.tg-stage:not(.auto) .tg-bar{animation:none!important;width:0}
@keyframes tgBar{to{width:100%}}

/* ---------- jeux + côté commerçant ---------- */
.tg-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:16px;margin-top:16px}
.tg-card{padding:clamp(24px,3.6vw,42px)}
.tg-card h3{font-size:clamp(22px,2.2vw,28px);letter-spacing:-.02em;margin:0 0 6px}
.tg-card > p{margin:0 0 22px;color:var(--ink-2);font-size:15.5px}
.tg-games{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.tg-games li{display:flex;gap:12px;align-items:center;padding:12px;border-radius:20px;background:var(--c,var(--card-2));transition:transform .5s var(--spring)}
.tg-games li:hover{transform:translateY(-4px) rotate(-.6deg)}
.tg-games img{flex:none;width:46px;height:46px;transition:transform .5s var(--spring)}
.tg-games li:hover img{transform:rotate(-10deg) scale(1.1)}
.tg-games b{display:block;font-size:15.5px;line-height:1.25}
.tg-games small{display:block;font-size:13px;line-height:1.4;color:var(--ink-2)}
.tg-card .inc{margin-bottom:0}
.tg-card .inc li{font-size:15.5px}
.tg-facts{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px}
.tg-facts .tag{font-size:13.5px;padding:7px 12px 7px 9px}
.tg-facts img{width:20px;height:20px}
.tg-week{display:flex;gap:14px;align-items:center;margin-top:18px;padding:16px 18px;border-radius:22px;background:linear-gradient(135deg,#FFF1CC,#F8E3B2);color:#4A3A12}
.tg-week img{flex:none;width:54px;height:54px;max-width:none;animation:tgBob 6s ease-in-out infinite}
.tg-week p{margin:0;font-size:14.5px;line-height:1.5}
.tg-week b{color:#2E230A}

.tg-cta{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-top:28px}
.tg-cta .hint-l{flex-basis:100%;margin-top:4px}
.tg-cta .btn img{width:24px;height:24px;margin-left:-4px}

/* ---------- adaptations ---------- */
@media (max-width:1120px){
  .tg-stage{grid-template-columns:1fr;justify-items:center}
  .tg-side{width:100%;max-width:640px}
}
@media (max-width:760px){
  .tg-stage{padding:26px 16px 22px;border-radius:32px;gap:22px}
  .tg-visual{gap:0}
  .tg-receipt-col{--fx:190px;--fy:-170px;position:absolute;z-index:5;left:-4px;bottom:6px;transform:scale(.58) rotate(-5deg);transform-origin:left bottom}
  .tg-visual{padding-left:70px}
  .tg-phone{height:min(520px,calc(100svh - 170px));min-height:400px;--ry:0deg;--rx:0deg}
  .tg-fl.f2,.tg-fl.f4{display:none}
  .tg-fl.f1{right:-18px}.tg-fl.f3{right:-14px}
  .tg-side h3{text-align:center}
  .tg-side > p{text-align:center}
  /* étapes en ruban horizontal */
  .tg-steps{grid-auto-flow:column;grid-auto-columns:78%;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;margin:0 -16px;padding:4px 16px 8px;scroll-padding-inline:16px}
  .tg-steps::-webkit-scrollbar{display:none}
  .tg-steps li{scroll-snap-align:start}
  .tg-steps button{height:100%;align-items:flex-start}
  .tg-steps button[aria-selected=true]{transform:none}
  .tg-steps small{max-height:none;opacity:1;margin-top:3px}
  .tg-grid{grid-template-columns:1fr}
}
@media (max-width:420px){
  .tg-visual{padding-left:58px}
  .tg-receipt-col{transform:scale(.52) rotate(-5deg)}
  .tg-games{grid-template-columns:1fr}
}
@media (hover:none){.tg-phone{transition:none}}
@media (prefers-reduced-motion:reduce){
  .tg-stars,.tg-fl{animation:none}
  .tg-stage.play .tg-receipt{animation:none;transform:none}
  .tg-stage.play .tg-beam,.tg-stage.play .tg-frame,.tg-stage.play .tg-ok,.tg-stage.play .tg-coins img{animation:none}
}
@media (max-width:600px){.tg-cta .btn{flex:1 1 100%}}
