/* grattage.css — la carte à gratter */
.grattage { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 70px 16px 24px; }
.grattage__cartes { display: flex; flex-direction: column; gap: 14px; width: min(88vw, 380px); }
.grattage__carte {
  position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--rayon); overflow: hidden; background: #fff;
  box-shadow: var(--ombre), 0 0 0 4px #fff, 0 0 0 7px var(--secondaire); transition: transform .25s ease, opacity .4s ease, filter .4s ease;
  --progression: 0%;
}
.grattage--3 .grattage__carte { aspect-ratio: 3 / 1.15; max-height: 22vh; }
.grattage__carte--active { transform: scale(1.02); }
.grattage__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; transition: opacity .5s ease; }
.grattage__canvas:active { cursor: grabbing; }
.grattage__carte--revele .grattage__canvas { opacity: 0; pointer-events: none; }
.grattage__carte--revele { transform: scale(1.04); }
.grattage__carte--grise { filter: grayscale(1); opacity: .45; }
.grattage__carte--grise .grattage__canvas { pointer-events: none; }
/* Sous le masque : visuel (image du lot ou emoji) + libellé. */
.grattage__dessous { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px; text-align: center; background: linear-gradient(160deg, #fff, var(--fond)); }
.grattage__dessous--gagne { background: linear-gradient(160deg, #fff 30%, var(--secondaire)); }
.grattage__dessous--perdu { background: linear-gradient(160deg, #fff, #ece9e2); }
.grattage__visuel { font-size: clamp(40px, 12vw, 64px); line-height: 1; display: flex; align-items: center; justify-content: center; max-height: 55%; }
.grattage__visuel img { width: auto; height: 100%; max-height: 110px; object-fit: contain; }
.grattage--3 .grattage__visuel { font-size: clamp(28px, 8vw, 40px); max-height: 50%; }
.grattage--3 .grattage__visuel img { max-height: 60px; }
.grattage__libelle { font-family: var(--police-titre); font-weight: 800; font-size: clamp(18px, 5.5vw, 26px); color: var(--primaire); line-height: 1.15; }
.grattage__dessous--perdu .grattage__libelle { color: var(--encre); font-size: clamp(16px, 5vw, 22px); }
.grattage--3 .grattage__libelle { font-size: clamp(15px, 4.5vw, 20px); }
/* Le lot gagné « pop » une fois le masque parti. */
.grattage__carte--revele .grattage__dessous--gagne .grattage__visuel, .grattage__carte--revele .grattage__dessous--ludique .grattage__visuel { animation: grattage-pop .5s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes grattage-pop { from { transform: scale(.5); } 60% { transform: scale(1.15); } to { transform: scale(1); } }
.grattage__aide { font-size: 15px; opacity: .8; text-align: center; margin: 0; max-width: 32ch; min-height: 20px; }
@media (prefers-reduced-motion: reduce) {
  .grattage__carte, .grattage__canvas { transition: none; }
  .grattage__carte--revele .grattage__visuel { animation: none !important; }
  .grattage__carte--active, .grattage__carte--revele { transform: none; }
}
@media (max-height: 640px) { .grattage__cartes { width: min(80vw, 340px); } .grattage__aide { font-size: 14px; } }

/* ---------- Version grille (07/11) : un ticket de Noël, des cases à gratter une à une ---------- */
.grattage--grille { justify-content: flex-start; padding-top: calc(70px + env(safe-area-inset-top)); }
.grattage__ticket { width: min(92vw, 400px); border-radius: 22px; padding: 14px 14px 16px; background: linear-gradient(160deg, var(--primaire), color-mix(in srgb, var(--primaire) 70%, #000));
  box-shadow: 0 0 0 3px var(--secondaire), 0 0 0 7px #fff, 0 16px 40px rgba(0,0,0,.3); position: relative; }
.grattage__ticket::before { content: ""; position: absolute; inset: 6px; border-radius: 17px; border: 1.5px dashed rgba(255,255,255,.35); pointer-events: none; }
.grattage__entete { text-align: center; color: #fff; margin-bottom: 12px; display: grid; gap: 2px; }
.grattage__entete b { font-family: var(--police-titre); font-weight: 800; font-size: 19px; line-height: 1.15; }
.grattage__entete small { font-size: 13px; color: var(--secondaire); font-weight: 700; }
.grattage__grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.grattage__case { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #fff, var(--fond)); box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); transition: transform .2s ease, box-shadow .2s ease; }
.grattage__case .grattage__canvas { border-radius: 14px; }
.grattage__sym { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(30px, 10vw, 46px); line-height: 1; }
.grattage__sym img { width: 70%; height: 70%; object-fit: contain; }
.grattage__sym--joker { background: radial-gradient(circle, color-mix(in srgb, var(--secondaire) 55%, #fff), transparent 70%); }
.grattage__case--vue .grattage__canvas { opacity: 0; pointer-events: none; }
.grattage__case--vue .grattage__sym { animation: grattage-pop .45s cubic-bezier(.2, 1.4, .4, 1); }
.grattage__case--paire { box-shadow: 0 0 0 3px var(--secondaire), 0 0 18px var(--secondaire); animation: grattage-suspense .7s ease-in-out infinite alternate; }
@keyframes grattage-suspense { from { transform: scale(1); } to { transform: scale(1.06); } }
.grattage__case--gagnante { box-shadow: 0 0 0 4px #ffd84a, 0 0 26px #ffd84a; transform: scale(1.08); z-index: 2; animation: none; }
.grattage__etincelles { position: absolute; left: 50%; top: 50%; pointer-events: none; z-index: 3; }
.grattage__etincelles i { position: absolute; width: 6px; height: 6px; margin: -3px; background: #ffd84a; clip-path: polygon(50% 0,62% 38%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 38%); animation: grattage-eclat .75s ease-out forwards; }
@keyframes grattage-eclat { to { transform: translate(var(--dx), var(--dy)) rotate(160deg); opacity: 0; } }
.grattage__tout[hidden] { display: none; }
.grattage__tout { width: auto; min-height: 44px; padding: 0 20px; }
.grattage--g6 .grattage__grille { grid-template-columns: repeat(3, 1fr); }
@media (prefers-reduced-motion: reduce) { .grattage__case--paire, .grattage__case--vue .grattage__sym { animation: none; } }
