/* Vachement Haut : interface « autocollant » (contours encre, ombres franches, boutons à rebord) assortie aux sprites.
   Ordre du fichier : jetons et briques, navigation (onglets, fenêtres, messages), collection / boutique / amis, en jeu, résultats, accueil.
   Mouvement : uniquement transform et opacity, jamais de flou. */
:root {
  --ink: #1D2433; --cream: #FFF6E5; --paper: #FFFFFF; --coral: #FF5A3C; --sun: #FFD23F; --teal: #2EC4B6; --violet: #8E6CEF; --muted: #5E6578;
  /* rebords : la même teinte en plus sombre, sous chaque bouton ou carte */
  --coral-d: #D43C1D; --sun-d: #E3A616; --teal-d: #1C9A8E; --violet-d: #6B49D6; --paper-d: #D5DAE4; --cream-d: #ECDDBF;
  --r: 18px; --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, sans-serif;
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
  --pop: cubic-bezier(.2, 1.4, .4, 1); --out: cubic-bezier(.2, .8, .2, 1);
  /* contour encre d'un texte blanc posé sur le décor */
  --trait: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink), 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overscroll-behavior: none; background: #0E1630; }
body { font-family: var(--font); color: var(--ink); -webkit-user-select: none; user-select: none; touch-action: manipulation; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
#app { position: relative; max-width: 480px; height: 100dvh; margin: 0 auto; overflow: hidden; background: linear-gradient(#4FB2FF, #CDEBFF 72%); }

/* ================================================================ écrans */
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: none; touch-action: none; }
.screen { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; padding: calc(var(--st) + 10px) 16px calc(var(--sb) + 90px); display: none; -webkit-overflow-scrolling: touch; }
[data-screen=menu] .screen { display: block; }
[data-screen=menu] #tabs { display: flex; }
[data-screen=game] #cv { display: block; }
#load { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; font-weight: 900; font-size: 22px; color: #fff; text-shadow: var(--trait); }
[data-screen=load] #load { display: flex; }
#load img { width: min(70%, 290px); height: auto; animation: bob 1s ease-in-out infinite alternate; }
#load .pts { display: flex; gap: 7px; }
#load .pts i { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2.5px solid var(--ink); animation: rebond .9s ease-in-out infinite; }
#load .pts i:nth-child(2) { animation-delay: .15s; }
#load .pts i:nth-child(3) { animation-delay: .3s; }
@keyframes bob { from { transform: rotate(-2deg); } to { transform: translateY(-8px) rotate(2deg); } }
@keyframes rebond { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-9px); } }

/* ================================================================ briques (partagées avec la carte de l'aventure : .btn .card .over .lead h2 .stars .pal .ico) */
.card { background: var(--cream); border: 2.5px solid var(--ink); border-radius: var(--r); box-shadow: inset 0 -3px 0 var(--cream-d), 0 4px 0 var(--ink); padding: 14px 14px 16px; margin-top: 14px; }
.card h3 { font-size: 17px; font-weight: 900; margin-bottom: 8px; }
/* bouton : une face colorée, un rebord plus sombre en bas, un reflet en haut ; il s'enfonce quand on appuie */
.btn { --lip: var(--coral-d); display: block; width: 100%; margin-top: 12px; padding: 13px 16px 16px; font-weight: 900; font-size: 19px; line-height: 1.15; color: #fff; background: var(--coral); border: 2.5px solid var(--ink); border-radius: 16px;
  box-shadow: inset 0 -4px 0 var(--lip), inset 0 2px 0 rgba(255, 255, 255, .3), 0 4px 0 var(--ink); text-shadow: 0 2px 0 rgba(0, 0, 0, .22); transition: transform .06s, box-shadow .06s; }
.btn:active { transform: translateY(3px); box-shadow: inset 0 -2px 0 var(--lip), inset 0 2px 0 rgba(255, 255, 255, .3), 0 1px 0 var(--ink); }
.btn small { display: block; font-size: 13px; font-weight: 700; opacity: .92; margin-top: 3px; }
.btn.sun { --lip: var(--sun-d); background: var(--sun); color: var(--ink); text-shadow: none; }
.btn.alt { --lip: var(--paper-d); background: var(--paper); color: var(--ink); text-shadow: none; }
.btn.teal { --lip: var(--teal-d); background: var(--teal); }
.btn.violet { --lip: var(--violet-d); background: var(--violet); }
.btn.sm { font-size: 15px; padding: 9px 10px 12px; border-radius: 14px; }
.btn.xl { font-size: 26px; padding: 15px 16px 19px; border-radius: 18px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .ico.md { display: block; margin: 0 auto 2px; }
.btn.sm > .ico { width: 20px; height: 20px; vertical-align: -5px; margin-right: 5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 999px; padding: 5px 12px; font-weight: 900; font-size: 15px; box-shadow: 0 3px 0 var(--ink); }
.chip .ico { margin-right: 2px; }
.chip.lvl { background: var(--violet); color: #fff; }
button.chip, .ic { transition: transform .06s, box-shadow .06s; }
button.chip:active, .ic:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.ic { width: 42px; height: 42px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--paper); font-size: 18px; font-weight: 900; box-shadow: 0 3px 0 var(--ink); padding: 0; }
.ic .ico { width: 26px; height: 26px; vertical-align: middle; }
.ic.xs { width: 30px; height: 30px; font-size: 13px; flex: none; box-shadow: 0 2px 0 var(--ink); }
.over { font-size: 13px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.big { font-size: 58px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.sub { font-weight: 700; font-size: 15px; margin-top: 6px; }
.lead { font-weight: 700; font-size: 15px; color: var(--ink); background: rgba(255, 255, 255, .7); border-radius: 12px; padding: 8px 12px; margin-top: 10px; }
.note { font-size: 14px; font-weight: 700; background: #fff; border-radius: 10px; padding: 7px 10px; margin-top: 8px; }
.legal { font-size: 12px; line-height: 1.45; color: var(--muted); margin-top: 16px; font-weight: 600; }
.legal a { color: inherit; }
h2 { font-size: 30px; font-weight: 900; color: #fff; text-shadow: var(--trait); }
h2 + .lead { margin-top: 8px; }
.ico { width: 1.3em; height: 1.3em; vertical-align: -0.3em; object-fit: contain; }
.ico.xs { width: 1.05em; height: 1.05em; vertical-align: -0.2em; }
.ico.sm { width: 22px; height: 22px; } .ico.md { width: 30px; height: 30px; vertical-align: -8px; } .ico.lg { width: 46px; height: 46px; } .ico.xl { width: 62px; height: 62px; }
.pal { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.pal span { background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 800; }
.pal span.ok { background: var(--sun); }
/* sous-onglets : un sélecteur d'un seul tenant */
.subs { display: flex; gap: 3px; margin-top: 12px; padding: 3px; background: var(--cream); border: 2.5px solid var(--ink); border-radius: 999px; box-shadow: 0 3px 0 var(--ink); }
.subs button { flex: 1; min-width: 0; min-height: 40px; padding: 0 4px; border: 0; border-radius: 999px; background: none; font-weight: 900; font-size: 14px; white-space: nowrap; color: var(--muted); transition: transform .06s; }
.subs button.on { background: var(--ink); color: #fff; }
.subs button:active { transform: scale(.95); }

/* ================================================================ navigation : onglets, fenêtres, messages */
#tabs { position: absolute; left: 0; right: 0; bottom: 0; display: none; gap: 2px; background: var(--cream); border-top: 2.5px solid var(--ink); padding: 5px 6px calc(var(--sb) + 5px); z-index: 5; }
#tabs button { position: relative; z-index: 0; flex: 1; min-width: 0; height: 56px; padding: 0; background: none; border: 0; border-radius: 14px; font-size: 11.5px; font-weight: 900; color: var(--muted); transition: transform .08s; }
#tabs button:active { transform: scale(.93); }
/* la pastille jaune de l'onglet courant grossit sous l'icône au lieu de sauter d'un bouton à l'autre */
#tabs button::before { content: ''; position: absolute; z-index: -1; inset: 0; border-radius: 14px; background: var(--sun); border: 2.5px solid var(--ink); box-shadow: inset 0 -3px 0 var(--sun-d); opacity: 0; transform: scale(.7); transition: opacity .14s, transform .24s var(--pop); }
#tabs button.on { color: var(--ink); }
#tabs button.on::before { opacity: 1; transform: none; }
#tabs img { display: block; width: 28px; height: 28px; margin: 0 auto 1px; filter: grayscale(.85) opacity(.65); transition: transform .24s var(--pop); }
#tabs button.on img { filter: none; transform: translateY(-2px) scale(1.18); }
#tabs button.pt::after { content: ''; position: absolute; top: 4px; left: calc(50% + 10px); width: 11px; height: 11px; border-radius: 50%; background: var(--coral); border: 2px solid var(--ink); }
#modal { position: absolute; inset: 0; background: rgba(14, 22, 48, .64); display: none; align-items: center; justify-content: center; padding: calc(var(--st) + 14px) 16px calc(var(--sb) + 14px); z-index: 20; }
#modal.on, #modal.out { display: flex; }
#modal.on { animation: fondu .16s both; }
#modal.on > * { animation: surgit .26s var(--pop) both; }
#modal.out { animation: fondu-fin .14s both; pointer-events: none; }
@keyframes fondu { from { opacity: 0; } }
@keyframes fondu-fin { to { opacity: 0; } }
@keyframes surgit { from { opacity: 0; transform: translateY(16px) scale(.9); } }
#modal .card { width: 100%; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 18px 16px; border-radius: 22px; text-align: center; box-shadow: inset 0 -3px 0 var(--cream-d), 0 6px 0 var(--ink); }
#modal h3 { font-size: 22px; }
#modal p { font-weight: 700; font-size: 15px; margin-top: 6px; }
#modal .left { text-align: left; }
#modal .legal { font-size: 12px; font-weight: 600; text-align: left; margin-top: 12px; }
#modal .grid2 input { margin-top: 8px; }
input[type=text], textarea { width: 100%; font: inherit; font-weight: 800; font-size: 17px; border: 2.5px solid var(--ink); border-radius: 12px; padding: 11px 12px; background: #fff; color: var(--ink); margin-top: 10px; -webkit-user-select: text; user-select: text; }
textarea { font-size: 11px; font-family: ui-monospace, monospace; height: 70px; resize: none; word-break: break-all; }
.sw-row { display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-weight: 900; font-size: 16px; border-top: 2px dashed rgba(29, 36, 51, .16); text-align: left; }
.sw-row:first-of-type { border: 0; }
.sw-row button { position: relative; flex: none; width: 56px; height: 32px; padding: 0; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--paper-d); }
.sw-row button::before { content: ''; position: absolute; inset: -9px -6px; }
.sw-row button::after { content: ''; position: absolute; left: 2px; top: 2px; width: 23px; height: 23px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); transition: transform .18s var(--pop); }
.sw-row button.on { background: var(--teal); }
.sw-row button.on::after { transform: translateX(24px); }
.bloc { background: #fff; border: 2px solid var(--ink); border-radius: 16px; padding: 10px 12px 14px; margin-top: 12px; text-align: left; }
.bloc .btn { margin-top: 10px; }
.bloc input { margin-top: 8px; }
#modal .bloc p:not(.over) { font-size: 13.5px; margin-top: 3px; }
#modal .bloc p.code-nuage { font: 900 21px/1.2 ui-monospace, monospace; letter-spacing: .04em; text-align: center; margin-top: 8px; -webkit-user-select: all; user-select: all; }
#modal .card:not(.fiche) > .ico { display: block; width: 62px; height: 62px; margin: 0 auto 4px; }
#modal .card:not(.fiche) > .pi { display: block; font-style: normal; font-size: 44px; line-height: 1.2; }
#modal .prix { font-size: 44px; margin-top: 8px; }
#rv { width: min(60vw, 250px); aspect-ratio: 9 / 16; border-radius: 14px; border: 2.5px solid var(--ink); background: #4FB2FF; margin-top: 8px; }
.ad { background: #1D2433 !important; color: #fff; }
.ad .slot { height: 180px; border: 2px dashed rgba(255, 255, 255, .5); border-radius: 12px; display: grid; place-items: center; margin-top: 10px; font-weight: 800; }
/* récompense qui s'ouvre (cadeau du jour) */
#modal .recomp > .ico { width: 92px; height: 92px; margin: 6px auto 2px; animation: starin .5s .12s both; }
.semainier { display: flex; justify-content: center; gap: 5px; margin: 12px 0 4px; }
.semainier span { flex: 0 1 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 2px solid var(--ink); background: #fff; font-weight: 900; font-size: 14px; color: var(--muted); }
.semainier .ok { background: var(--teal); color: #fff; }
.semainier .now { background: var(--sun); color: var(--ink); box-shadow: 0 3px 0 var(--ink); transform: translateY(-3px); }
/* messages : ils descendent du haut, restent trois secondes, repartent */
#toast { position: absolute; left: 14px; right: 14px; top: calc(var(--st) + 10px); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; z-index: 30; }
#app[data-screen=game] #toast { top: calc(var(--st) + 114px); }
#toast div { max-width: 100%; background: var(--ink); color: #fff; font-weight: 800; font-size: 14.5px; line-height: 1.25; text-align: center; padding: 10px 16px; border-radius: 16px; border: 2px solid #fff; box-shadow: 0 4px 0 rgba(14, 22, 48, .35); animation: toast 3.2s both; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-14px) scale(.94); } 6% { opacity: 1; transform: translateY(2px) scale(1.02); } 9%, 91% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-10px); } }
/* confettis des grands moments (trois étoiles, record, victoire, niveau gagné) */
.confettis { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 25; }
.confettis i { position: absolute; left: -5px; top: -7px; width: 10px; height: 14px; border-radius: 3px; border: 1.5px solid var(--ink); opacity: 0; animation: confetti 1.2s cubic-bezier(.12, .7, .3, 1) both; }
@keyframes confetti { 0% { opacity: 1; transform: scale(.4); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)); } }

/* ================================================================ collection, boutique, pass, amis */
.ph { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.ph .chip { flex: none; }
.sec { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 17px; font-weight: 900; margin: 20px 0 0; color: var(--ink); }
.sec em { flex: none; font-style: normal; font-size: 13px; background: rgba(255, 255, 255, .75); border-radius: 999px; padding: 2px 9px; }
.bar { height: 14px; border-radius: 999px; border: 2.5px solid var(--ink); background: #fff; overflow: hidden; margin-top: 8px; }
.bar i { display: block; width: 100%; height: 100%; background: var(--sun); box-shadow: inset 0 -3px 0 var(--sun-d); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; }
/* cases : objets du catalogue, pinces, yeux, ciels */
.cgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.cell { position: relative; min-width: 0; min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding: 8px 4px 10px; text-align: center; font-weight: 900; font-size: 12.5px; line-height: 1.15;
  color: var(--ink); background: var(--cream); border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: inset 0 -3px 0 var(--cream-d), 0 4px 0 var(--ink); }
button.cell { transition: transform .06s, box-shadow .06s; }
button.cell:active { transform: translateY(3px); box-shadow: inset 0 -1px 0 var(--cream-d), 0 1px 0 var(--ink); }
.cell > img:not(.ico) { max-width: 76px; max-height: 58px; margin: auto; }
.cell.no { color: var(--muted); background: #EFE7D6; box-shadow: 0 4px 0 var(--ink); font-size: 16px; }
.cell.no > img { filter: brightness(0); opacity: .13; }
.cell em { font-style: normal; font-weight: 800; font-size: 11px; color: var(--muted); }
.cell .nb { position: absolute; top: 5px; left: 7px; font-style: normal; font-size: 11px; font-weight: 900; color: var(--muted); }
.cell.on { background: var(--sun); box-shadow: inset 0 -3px 0 var(--sun-d), 0 4px 0 var(--ink); }
.cell.on em { color: var(--ink); }
.cell .px { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 900; border: 2px solid var(--ink); border-radius: 999px; background: #fff; padding: 3px 10px; }
.cell .px.prix { background: var(--sun); }
.ico.star { position: absolute; top: -10px; right: -8px; width: 26px; height: 26px; }
.sw { width: 64px; height: 44px; border-radius: 10px; border: 2.5px solid var(--ink); margin: auto; }
.eyes { display: flex; gap: 4px; justify-content: center; align-items: center; height: 48px; margin: auto; }
.eyes i { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2.5px solid var(--ink); position: relative; display: block; font-style: normal; }
.eyes i::after { content: ''; position: absolute; width: 11px; height: 11px; border-radius: 50%; background: #15161F; left: 6px; top: 8px; }
.eyes.manga i::after { width: 16px; height: 16px; left: 3px; top: 3px; box-shadow: inset 4px 4px 0 -1px #fff; }
.eyes.coeur i::after { content: '❤'; background: none; color: #E63946; font-size: 13px; line-height: 1; left: 3.5px; top: 4.5px; width: auto; height: auto; }
.eyes.lunettes i { background: #15161F; } .eyes.lunettes i::after { display: none; }
.eyes.fatigue i { background: linear-gradient(#C9B8A6 46%, #fff 46%); }
.eyes.cyclope i:last-child { display: none; } .eyes.cyclope i { width: 36px; height: 36px; } .eyes.cyclope i::after { left: 10px; top: 12px; }
/* lignes de la boutique : icône, nom et description, prix */
.offer { display: flex; align-items: center; gap: 10px; padding: 12px 12px 14px; }
.offer > .ico, .offer > .pi { flex: none; width: 46px; height: 46px; }
.offer > .pi { font-style: normal; font-size: 32px; line-height: 46px; text-align: center; }
.offer > div { flex: 1; min-width: 0; }
.offer b { display: block; font-size: 16px; font-weight: 900; line-height: 1.2; }
.offer span { display: block; font-size: 13px; font-weight: 700; line-height: 1.3; color: var(--muted); margin-top: 2px; }
.offer .btn { flex: none; width: auto; margin: 0; white-space: nowrap; }
.offer.got { background: #EFE7D6; box-shadow: 0 4px 0 var(--ink); }
.acquis { flex: none; font-style: normal; font-weight: 900; font-size: 13px; color: #fff; background: var(--teal); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 10px; }
.offer > .boo { position: relative; flex: none; width: 50px; height: 50px; margin: 0; display: grid; place-items: center; background: #fff; border: 2px solid var(--ink); border-radius: 14px; }
.boo .ico { width: 38px; height: 38px; }
.boo i { position: absolute; right: -7px; top: -8px; min-width: 22px; height: 22px; padding: 0 5px; display: grid; place-items: center; border-radius: 999px; background: var(--ink); color: #fff; font-style: normal; font-size: 12px; font-weight: 900; }
/* pass de saison */
.pass .sub { font-size: 13.5px; margin-top: 0; }
.pass .over { margin-top: 6px; }
.tier { display: grid; grid-template-columns: 44px 1fr 1fr; gap: 6px; align-items: stretch; padding: 5px 0; font-weight: 800; font-size: 12.5px; line-height: 1.2; }
.tier > b { display: flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 900; }
.tier span { display: grid; place-items: center; min-height: 40px; background: #fff; border: 2px solid var(--ink); border-radius: 10px; padding: 4px 6px; text-align: center; text-wrap: balance; }
.tier span.ok { background: var(--teal); color: #fff; }
.tier span.lock { background: #EEE6D6; color: var(--muted); border-style: dashed; }
.tier.off > b { opacity: .45; }
.tier.tete { padding: 0 0 2px; font-size: 11.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: center; }
/* succès, profil */
.suc { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 10px 12px 12px; }
.suc > .ico { flex: none; width: 36px; height: 36px; }
.suc > div { flex: 1; min-width: 0; }
.suc b { display: block; font-size: 15px; font-weight: 900; line-height: 1.2; }
.suc span { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.suc em { flex: none; font-style: normal; font-weight: 900; font-size: 13.5px; white-space: nowrap; }
.suc .bar { height: 10px; margin-top: 5px; border-width: 2px; }
.suc.ok { background: var(--sun); box-shadow: inset 0 -3px 0 var(--sun-d), 0 4px 0 var(--ink); }
.suc.ok span { color: var(--ink); }
.profil { text-align: center; padding-top: 16px; }
.profil h3 { font-size: 24px; margin: 0; }
.profil .sub { font-size: 13.5px; margin-top: 4px; }
.nivo { width: 76px; height: 76px; margin: 0 auto 6px; display: grid; place-items: center; border-radius: 50%; background: var(--violet); color: #fff; border: 2.5px solid var(--ink); box-shadow: inset 0 -5px 0 var(--violet-d), 0 4px 0 var(--ink);
  font-size: 34px; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.stats div { min-width: 0; background: var(--cream); border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 0 3px 0 var(--ink); padding: 9px 3px 8px; text-align: center; }
.stats b { display: block; font-size: 17px; font-weight: 900; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stats span { display: block; font-size: 11px; font-weight: 800; line-height: 1.15; color: var(--muted); margin-top: 3px; }
/* listes : classement du jour, duos, défis reçus */
.rank { display: flex; align-items: center; gap: 10px; min-height: 46px; font-weight: 900; font-size: 15px; padding: 5px 0; border-top: 2px dashed rgba(29, 36, 51, .16); }
.rank:first-of-type { border: 0; }
.rank > b { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--ink); background: #fff; color: var(--ink); font-size: 13px; }
.rank > b.r1 { background: var(--sun); }
.rank > b.r2 { background: var(--paper-d); }
.rank > b.r3 { background: #E8A26B; }
.rank span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank span small { display: block; font-size: 12px; font-weight: 700; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.rank.me { color: var(--coral); }
.rank .btn { flex: none; width: auto; margin: 0; }
.rank .ic.xs { position: relative; }
.rank .ic.xs::before { content: ''; position: absolute; inset: -8px; }
.screen .card h3 + .sub { margin-top: 0; }

/* ================================================================ en jeu : barre du haut, objectif, joueurs du duo, boosters */
/* Trois colonnes (pause | hauteur + cœurs | compteur + objet suivant) : les côtés ont la même largeur, la hauteur reste centrée et rien ne sort de l'écran. */
#hud { position: absolute; top: calc(var(--st) + 10px); left: 10px; right: 10px; display: none; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 6px; pointer-events: none; z-index: 3; }
[data-screen=game] #hud { display: grid; }
#hud .ic { position: relative; justify-self: start; width: 44px; height: 44px; font-size: 0; pointer-events: auto; }
#hud .ic::before, #hud .ic::after { content: ''; position: absolute; left: 50%; top: 50%; width: 5px; height: 16px; margin: -8px 0 0 -2.5px; border-radius: 3px; background: var(--ink); transition: transform .2s; }
#hud .ic::before { transform: translateX(-4.5px); }
#hud .ic::after { transform: translateX(4.5px); }
#app.fini #hud .ic::before { transform: rotate(45deg) scaleY(1.25); }
#app.fini #hud .ic::after { transform: rotate(-45deg) scaleY(1.25); }
#app.fini #hud > :not(.ic) { visibility: hidden; }
#hmid { min-width: 0; text-align: center; }
#hgt { white-space: nowrap; font-size: 28px; line-height: 1.05; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums;
  text-shadow: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink), 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink); }
#hearts { display: flex; justify-content: center; gap: 2px; margin-top: 3px; }
#hearts .ico { width: 19px; height: 19px; }
.ico.off { filter: grayscale(1); opacity: .32; }
#nextbox { position: relative; justify-self: end; display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 5px 0 10px; border-radius: 14px; border: 2.5px solid var(--ink); background: var(--cream); box-shadow: 0 3px 0 var(--ink); }
#nextbox::after { content: 'suivant'; position: absolute; right: 5px; bottom: -11px; font-size: 9.5px; line-height: 1.35; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--ink); border-radius: 999px; padding: 1px 6px; }
#count { font-weight: 900; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
#next { width: 32px; height: 32px; object-fit: contain; }

#obj { position: absolute; top: calc(var(--st) + 70px); left: 10px; right: 10px; display: none; gap: 8px; justify-content: center; z-index: 3; pointer-events: none; }
#boosts { position: absolute; left: 0; right: 0; bottom: calc(var(--sb) + 16px); display: none; justify-content: center; gap: 14px; z-index: 3; pointer-events: none; }
[data-screen=game] #obj, [data-screen=game] #boosts { display: flex; }
#app.fini #obj, #app.fini #boosts { display: none; }
.but { display: flex; align-items: center; gap: 7px; max-width: 100%; white-space: nowrap; background: var(--cream); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: 13.5px; box-shadow: 0 2px 0 var(--ink); }
.but > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 900; }
.but > span { background: #fff; border-radius: 999px; padding: 1px 8px; box-shadow: inset 0 0 0 1.5px rgba(29, 36, 51, .16); }
.but > span:empty { display: none; }
.but i { font-style: normal; }
.pl { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 5px 10px 5px 7px; box-shadow: 0 3px 0 var(--c); transition: transform .18s; }
.pl.on { background: var(--c); color: #fff; box-shadow: 0 3px 0 var(--ink); transform: translateY(2px); }
.pl > .ico { flex: none; width: 28px; height: 28px; padding: 2px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--ink); }
.pl > div { flex: 1; min-width: 0; }
.pl b { display: block; font-size: 14px; line-height: 1.15; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl .hp { display: inline-flex; gap: 1px; margin-top: 2px; padding: 1px 4px; border-radius: 999px; background: #fff; }
.pl .hp .ico { width: 13px; height: 13px; }
.pl em { font-style: normal; font-weight: 900; font-size: 22px; font-variant-numeric: tabular-nums; }
#boosts button { pointer-events: auto; position: relative; width: 58px; height: 58px; border-radius: 16px; border: 2.5px solid var(--ink); background: var(--cream); box-shadow: 0 4px 0 var(--ink); padding: 0; transition: transform .06s, box-shadow .06s; }
#boosts button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
#boosts img { width: 40px; height: 40px; vertical-align: middle; }
#boosts i { position: absolute; right: -7px; top: -9px; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 999px; background: var(--ink); color: #fff; font: 900 13px var(--font); font-style: normal; display: grid; place-items: center; }
#boosts .vide img { filter: grayscale(1); opacity: .4; }
#boosts .vide i { background: var(--muted); }
#hint { position: absolute; left: 0; right: 0; top: 40%; text-align: center; font-size: 26px; line-height: 1.15; font-weight: 900; color: #fff; pointer-events: none; display: none; z-index: 3; animation: pulse .7s ease-in-out infinite alternate;
  text-shadow: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink), 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink); }
#hint.on { display: block; }
#hint.tap::after { content: ''; display: block; width: 52px; height: 52px; margin: 14px auto 0; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 0 0 2.5px var(--ink), inset 0 0 0 2.5px var(--ink); animation: tap 1.1s ease-out infinite; }
@keyframes pulse { to { transform: scale(1.08); } }
@keyframes tap { from { transform: scale(.45); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }

/* ================================================================ feuille de résultat : tient sans défiler, une action principale */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 72dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--cream); border-top: 2.5px solid var(--ink); border-radius: 26px 26px 0 0;
  padding: 14px 16px calc(var(--sb) + 14px); text-align: center; z-index: 6; box-shadow: 0 -5px 0 rgba(29, 36, 51, .14); transform: translateY(105%); visibility: hidden; transition: transform .32s cubic-bezier(.2, .85, .25, 1), visibility 0s .32s; }
.sheet.open { transform: none; visibility: visible; transition-delay: 0s; }
.sheet .big { font-size: 50px; }
.sheet .sub { font-size: 14px; line-height: 1.3; margin-top: 4px; text-wrap: balance; }
.sheet .sub span { font-size: 13px; color: var(--muted); }
.sheet .duel { font-weight: 900; font-size: 18px; margin-top: 8px; color: var(--coral); }
.stars { display: flex; justify-content: center; gap: 6px; margin: 4px 0; }
.sheet .stars { align-items: flex-end; gap: 2px; margin: 2px 0 0; }
.sheet .stars .ico { width: 54px; height: 54px; animation: starin .45s .25s both; }
.sheet .stars .ico:nth-child(2) { width: 68px; height: 68px; animation-delay: .42s; }
.sheet .stars .ico:nth-child(3) { animation-delay: .59s; }
@keyframes starin { from { transform: scale(0) rotate(-40deg); opacity: 0; } 70% { transform: scale(1.25) rotate(6deg); opacity: 1; } }
.emo { display: flex; justify-content: center; gap: 3px; margin-top: 8px; }
.emo i { flex: 0 1 14px; min-width: 0; height: 14px; border-radius: 4px; border: 2px solid var(--ink); background: #fff; }
.emo .ok { background: #3FB26B; }
.emo .ko { background: var(--coral); }
.emo .sw { background: var(--sun); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.chips:empty { display: none; }
.chips .best { background: var(--sun); }
.sheet .chips .chip { animation: surgit .3s .35s var(--pop) both; }
.sheet .chips .chip:nth-child(2) { animation-delay: .45s; }
.sheet .chips .chip:nth-child(3) { animation-delay: .55s; }
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.vs > div { position: relative; min-width: 0; background: #fff; border: 2.5px solid var(--ink); border-radius: 16px; padding: 8px 8px 7px; box-shadow: 0 4px 0 var(--c); }
.vs b { display: block; font-size: 15px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs em { display: block; font-style: normal; font-size: 34px; font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; }
.vs span { display: flex; justify-content: center; gap: 2px; margin-top: 2px; }
.vs span .ico { width: 16px; height: 16px; }
.vs .win { background: var(--sun); }
.vs > div > .ico { position: absolute; top: -23px; left: 50%; margin-left: -18px; width: 36px; height: 36px; }
.vs .win > .ico { animation: starin .5s .3s both; }
/* progression du niveau de joueur */
.xprow { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-weight: 900; font-size: 13px; }
.xprow .chip { font-size: 12.5px; padding: 3px 9px; box-shadow: 0 2px 0 var(--ink); }
.xprow .bar { flex: 1; height: 12px; margin: 0; }
.xprow .bar i { transition: transform .7s var(--out); }
.xprow em { font-style: normal; color: var(--violet); white-space: nowrap; }
.xprow.up .chip { background: var(--sun); color: var(--ink); animation: starin .5s .5s both; }
/* récompenses de la partie : une rangée qui défile sur le côté au lieu d'allonger la feuille */
.gains { display: flex; gap: 8px; margin: 10px -16px 0; padding: 0 16px 3px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.gains::-webkit-scrollbar { display: none; }
.gain { flex: none; display: flex; align-items: center; gap: 7px; max-width: 250px; text-align: left; background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 5px 10px 5px 8px; font-size: 12.5px; font-weight: 800; line-height: 1.2; }
.gain:first-child { margin-left: auto; }
.gain:last-child { margin-right: auto; }
.gain.or { background: var(--sun); }
.gain > i { font-style: normal; font-size: 18px; }
.gain .ico { flex: none; }
.gain.neuf > span { white-space: nowrap; }
.gain.neuf img { flex: none; width: 28px; height: 28px; object-fit: contain; }
.acts { display: grid; grid-template-columns: 1.5fr 1fr; gap: 10px; margin-top: 12px; }
.acts .btn { margin: 0; font-size: 17px; padding: 12px 8px 15px; }
.minis { display: flex; gap: 8px; margin-top: 10px; }
.minis .btn { flex: 1; min-width: 0; min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; margin: 0; font-size: 11.5px; padding: 5px 2px 8px; border-radius: 12px; box-shadow: inset 0 -3px 0 var(--lip), 0 3px 0 var(--ink); }
.minis .ico { width: 24px; height: 24px; }
.acts .ico { width: 22px; height: 22px; vertical-align: -5px; margin-right: 5px; }
.minis .btn:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 var(--lip), 0 1px 0 var(--ink); }
.minis .btn small { display: inline; margin: 0; font-size: 11.5px; font-weight: 900; opacity: 1; }
.sheet .legal { margin-top: 10px; }
.inst { display: flex; align-items: center; gap: 10px; text-align: left; background: #fff; border: 2px dashed var(--ink); border-radius: 14px; padding: 8px 10px; margin-top: 12px; font-weight: 800; font-size: 13px; }
.inst .btn { flex: none; width: auto; margin: 0; }

/* ================================================================ accueil : une action principale, les modes en tuiles, le reste en dessous */
/* Le décor du menu rappelle le jeu : nuages partout, collines sur l'accueil. Calque fixe, rien ne défile avec. */
#app::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .85;
  background: url(assets/obj/nuage1.webp) right -56px top 12% / 200px auto no-repeat, url(assets/obj/nuage2.webp) left -44px top 45% / 170px auto no-repeat; }
#app[data-screen=game]::before { display: none; }
#app[data-screen=menu][data-tab=home] { background: radial-gradient(ellipse 75% 150px at 12% 100%, #6FC267 0 99%, transparent 100%), radial-gradient(ellipse 85% 205px at 92% 100%, #97D88A 0 99%, transparent 100%), linear-gradient(#4FB2FF, #CDEBFF 72%); }
.top { display: flex; align-items: center; gap: 6px; }
.top .sp { flex: 1; }
.top .chip { font-size: 14px; padding: 4px 10px 4px 7px; }
.top .chip.lvl { padding: 4px 11px; }
/* le titre est le logo peint (ChatGPT Images, generation/recu/logo.png) : même allure sur tous les téléphones */
.logo { margin: 2px 0 -4px; }
.logo img { display: block; width: min(52%, 230px); height: auto; margin: 0 auto; animation: flotte 3.4s ease-in-out infinite alternate; }
@keyframes flotte { from { transform: rotate(-1.6deg) translateY(1px); } to { transform: rotate(1.6deg) translateY(-3px); } }
/* bandeaux : défi reçu, duo en attente, cadeau du jour */
.alerte { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 12px; padding: 8px 10px; text-align: left; font: inherit; color: #fff; background: var(--coral); border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 var(--ink); }
.alerte.duo { background: var(--violet); }
.alerte.gift { background: var(--sun); color: var(--ink); transition: transform .06s, box-shadow .06s; }
.alerte.gift:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.alerte > div { flex: 1; min-width: 0; }
.alerte b { display: block; font-size: 15.5px; font-weight: 900; line-height: 1.2; }
.alerte > div > span { display: block; font-size: 12.5px; font-weight: 700; margin-top: 1px; }
.alerte .btn { --lip: var(--paper-d); flex: none; width: auto; margin: 0; background: var(--paper); color: var(--ink); text-shadow: none; }
.alerte > .ico { flex: none; width: 40px; height: 40px; }
.alerte.gift > .ico { width: 46px; height: 46px; animation: hochement 1.6s ease-in-out infinite; }
@keyframes hochement { 0%, 55%, 100% { transform: none; } 66% { transform: rotate(-11deg) scale(1.1); } 80% { transform: rotate(9deg) scale(1.1); } }
/* la carte vedette : ce qu'il faut faire maintenant (tour du jour, puis aventure) */
.vedette { position: relative; margin-top: 32px; padding: 12px 12px 14px; background: var(--cream); border: 2.5px solid var(--ink); border-radius: 22px; box-shadow: 0 5px 0 var(--ink); }
.vedette .art { position: absolute; left: 10px; top: -30px; width: 92px; height: 128px; animation: sway 2.8s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.vedette img.art { object-fit: contain; object-position: 50% 100%; }
.vedette .pile { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.vedette .pile img { max-width: 80px; max-height: 46px; margin-top: -5px; transform: rotate(var(--r)); }
@keyframes sway { from { transform: rotate(-2.2deg); } to { transform: rotate(2.2deg); } }
.vedette .txt { margin-left: 104px; min-height: 86px; display: flex; flex-direction: column; justify-content: center; }
.vedette h3 { font-size: 23px; font-weight: 900; line-height: 1.1; margin-top: 1px; }
.vedette .txt p:last-child { font-size: 13.5px; font-weight: 700; line-height: 1.25; color: var(--muted); margin-top: 3px; }
.vedette .btn { margin-top: 10px; animation: battre 1.5s ease-in-out infinite; }
.vedette .btn:active { animation: none; }
@keyframes battre { 50% { transform: scale(1.035); } }
.fait { display: flex; align-items: center; gap: 10px; padding: 9px 12px 11px; margin-top: 12px; }
.fait > .ico { flex: none; width: 34px; height: 34px; }
.fait > div { flex: 1; min-width: 0; }
.fait strong { display: block; font-size: 22px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fait span { font-size: 13px; font-weight: 700; color: var(--muted); }
.fait span b { color: var(--ink); font-variant-numeric: tabular-nums; }
.fait .btn { flex: none; width: auto; margin: 0; }
.btn.mode { display: flex; align-items: center; gap: 12px; text-align: left; font-size: 20px; padding: 6px 14px 10px; }
.btn.mode > img { flex: none; height: 56px; width: 56px; object-fit: contain; }
.btn.mode > span { min-width: 0; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.tuile { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px; font: inherit; font-weight: 900; font-size: 16px; line-height: 1.15; color: var(--ink); background: var(--paper);
  border: 2.5px solid var(--ink); border-radius: 18px; box-shadow: 0 4px 0 var(--ink); transition: transform .06s, box-shadow .06s; }
.tuile:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.tuile .ico { width: 40px; height: 40px; }
.tuile small { font-size: 11.5px; font-weight: 700; line-height: 1.2; }
.tuile.violet { background: var(--violet); color: #fff; text-shadow: 0 1.5px 0 rgba(0, 0, 0, .22); }
.tuile.sun { background: var(--sun); }
.pips { display: flex; gap: 3px; margin-top: 3px; }
.pips i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; }
.pips .ok { background: var(--sun); }
.card h3.hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chip.mini { font-size: 12.5px; padding: 2px 9px; box-shadow: 0 2px 0 var(--ink); }
.chip.best { background: var(--sun); }
.mis { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 14px; padding: 5px 0; }
.mis > i { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--ink); background: #fff; }
.mis > .ico { flex: none; width: 24px; height: 24px; }
.mis.ok span { color: var(--muted); }
.mis span { flex: 1; }
.mis em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ================================================================ mouvement réduit : tout arrive d'un coup à sa place */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  #toast div { animation: none; }
}
