/* La course à la jaquette — Op GTA VI, jeu en ligne d'un centre Mercialys
   Styles des écrans de l'application (390 × 844, thème néon nuit). Le jeu a sa propre feuille, css/jeu.css,
   chargée dans son Shadow DOM. */

:root {
  --bg: #160B2E;
  --card: #24143F;
  --line: #3A2560;
  --off: #2E1C4C;
  --off-ink: #9D8CBA;
  --ink: #FFF6FB;
  --mute: #D8CCEB;
  --mute2: #B6A6D0;
  --ph: #8E7FAE;
  --pink: #FF4FA3;
  --pink2: #FF8CC4;
  --orange: #FF9F45;
  --gold: #FFC94A;
  --teal: #4FE0D0;
  --err: #FF6B6B;
  --err-ink: #FF8A8A;
  --violet: #6A2FB8;
  --f-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-anton: Anton, Impact, "Arial Narrow", sans-serif;
  --f-bungee: Bungee, "Arial Black", sans-serif;
  --f-script: Yellowtail, "Brush Script MT", cursive;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #0B0616;
  color: var(--ink);
  font-family: var(--f-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--pink2); }
a:hover { color: #FFB3D7; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
button { font-family: inherit; }

/* ---------- Coque : le téléphone ---------- */
.shell { height: 100vh; }
.stage { height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.phone-wrap { position: relative; flex: none; width: 390px; height: 844px; }
.phone {
  position: absolute; top: 0; left: 0; width: 390px; height: 844px;
  border-radius: 28px; overflow: hidden; background: var(--bg);
  transform-origin: 0 0;
  box-shadow: 0 0 0 1px #2C1A4A, 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 90px rgba(255, 79, 163, 0.12);
}
.screen {
  position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain; scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }
.screen.enter { animation: enter 0.22s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Couche du jeu : hôte du Shadow DOM (voir css/jeu.css) */
.game-layer { position: absolute; inset: 0; background: #120c22; }
.noscript { margin: 0; padding: 40px 24px; font-size: 15px; line-height: 1.5; color: var(--mute); text-align: center; }

/* Téléphone réel : plein écran */
body.mobile .shell { height: auto; }
body.mobile .stage { display: block; height: auto; padding: 0; }
body.mobile .phone-wrap { width: 100vw; height: 100vh; height: 100dvh; }
body.mobile .phone { position: fixed; inset: 0; width: auto; height: auto; border-radius: 0; transform: none !important; box-shadow: none; }

/* ---------- Toast et feuille ---------- */
.toast {
  position: absolute; z-index: 30; left: 16px; right: 16px; top: 14px;
  padding: 12px 14px; border-radius: 14px; background: #2A1748; border: 1.5px solid var(--pink);
  color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.4; text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); animation: enter 0.2s ease-out;
}
.sheet { position: absolute; z-index: 40; inset: 0; background: rgba(10, 5, 22, 0.72); display: flex; align-items: flex-end; }
.sheet-card {
  width: 100%; max-height: 86%; overflow-y: auto; background: var(--bg); border-top: 1.5px solid var(--line);
  border-radius: 22px 22px 0 0; padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 12px;
  animation: enter 0.22s ease-out;
}
.sheet-card > * { flex-shrink: 0; } /* contenu plus haut que la feuille : elle défile, les boutons gardent leur taille */
.sheet-card h2 { margin: 0; font-family: var(--f-anton); font-weight: 400; font-size: 28px; text-transform: uppercase; }
.sheet-card ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.5; color: var(--mute); }

/* ---------- Briques communes des écrans ---------- */
.scr { min-height: 100%; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font-family: var(--f-body); }
.scr-pad { padding: 20px 24px 24px; gap: 14px; }
.body-pad { flex: 1; padding: 18px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.strip { flex: none; height: 5px; margin: -20px -24px 0; background: linear-gradient(90deg, #FF9F45, #FF4FA3, #6A2FB8); }
.strip.gold { background: linear-gradient(90deg, #FFC94A, #FF9F45, #FF4FA3); }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; }
.icon-btn {
  flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: var(--card); color: var(--ink);
}
.icon-btn:hover { color: var(--ink); background: #2E1A50; }
.logo { display: block; border-radius: 8px; flex: none; }
/* Logo en longueur (logoRatio dans js/centre.js) : pas d'arrondi, proportions gardées */
.logo-large { border-radius: 0; object-fit: contain; max-width: 45vw; }
/* Centre sans logo dans le zip : pastille à son sigle (js/centre.js) */
.logo-sigle { display: inline-flex; align-items: center; justify-content: center; background: var(--ink); color: var(--bg); font-family: var(--f-anton); letter-spacing: 0.02em; line-height: 1; }
.anton-h { margin: 0; font-family: var(--f-anton); font-weight: 400; font-size: 34px; line-height: 1.05; text-transform: uppercase; }
.kicker { font-size: 12px; font-weight: 800; color: var(--orange); }
.lead { margin: 0; font-size: 13px; line-height: 1.5; color: var(--mute); }
.card { background: var(--card); border-radius: 16px; }
.cta { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.small-note { margin: 0; font-size: 11px; line-height: 1.5; color: var(--mute2); text-align: center; }
.hearts { display: flex; gap: 6px; }
.hearts svg { display: block; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 56px; padding: 0 16px;
  border-radius: 14px; border: 0; background: var(--pink); color: var(--bg);
  font-family: inherit; font-weight: 800; font-size: 17px; text-decoration: none; cursor: pointer; text-align: center;
  transition: background 0.12s, transform 0.08s;
}
.btn:hover { color: var(--bg); background: #FF67B0; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { background: var(--off); color: var(--off-ink); cursor: default; }
.btn.gold { background: var(--gold); }
.btn.gold:hover { background: #FFD46E; }
.btn-2 {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 48px; border-radius: 14px;
  border: 1.5px solid var(--line); background: transparent; color: var(--ink);
  font-family: inherit; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer;
}
.btn-2:hover { color: var(--ink); border-color: #5C3D8E; }

/* Formulaires */
.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; background: var(--card); border-radius: 12px; padding: 4px; }
.tab { height: 40px; border-radius: 9px; border: 0; font-size: 14px; font-weight: 700; cursor: pointer; background: transparent; color: var(--mute); }
.tab[aria-selected="true"] { background: var(--pink); color: var(--bg); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; color: var(--mute); }
.input {
  height: 48px; width: 100%; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card);
  color: var(--ink); padding: 0 12px; font-size: 16px; font-family: inherit; outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input::placeholder { color: var(--ph); }
.input:focus { box-shadow: 0 0 0 3px rgba(255, 79, 163, 0.28); }
.input.ok { border-color: var(--teal); }
.input.err { border-color: var(--err); }
.input.pin { height: 52px; font-size: 22px; letter-spacing: 0.45em; padding: 0 14px; }
.input.pin-login { width: 160px; font-size: 24px; letter-spacing: 0.5em; padding: 0 16px; }
.msg { font-size: 12px; line-height: 1.4; color: var(--mute2); }
.msg.err { color: var(--err-ink); }
.msg.ok { color: var(--teal); }
.suggest { align-self: flex-start; background: none; border: 0; padding: 4px 0; color: var(--gold); font-size: 13px; font-weight: 700; text-decoration: underline; cursor: pointer; text-align: left; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--mute); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--pink); }

/* ---------- 1 · Accueil ---------- */
.main-hero { position: relative; height: 300px; flex: none; padding: 20px 24px 0; overflow: hidden; }
.sun { position: absolute; right: -80px; top: 120px; overflow: visible; animation: sunFloat 7s ease-in-out infinite, sunGlow 7s ease-in-out infinite; will-change: transform, filter; }
.sun-top { animation: sunTop 9s ease-in-out infinite; }
.sun-bottom { animation: sunBottom 9s ease-in-out infinite; }
.band { transform-box: fill-box; transform-origin: center; animation: band 4.5s ease-in-out infinite; }
.band-2 { animation-delay: -1.1s; } .band-3 { animation-delay: -2.2s; } .band-4 { animation-delay: -3.3s; }
@keyframes sunFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes sunGlow { 0%, 100% { filter: drop-shadow(0 0 16px rgba(255, 159, 69, 0.55)); } 50% { filter: drop-shadow(0 0 36px rgba(255, 79, 163, 0.8)); } }
@keyframes sunTop { 0%, 100% { stop-color: #FFD36E; } 50% { stop-color: #FFB25C; } }
@keyframes sunBottom { 0%, 100% { stop-color: #FF4FA3; } 50% { stop-color: #FF7A59; } }
@keyframes band { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.35); } }
.partner { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.partner span { font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); }
.neon-1, .neon-2 { font-family: var(--f-bungee); line-height: 1; white-space: nowrap; }
.neon-1 { font-size: 38px; color: var(--ink); text-shadow: 0 0 8px #FF4FA3, 0 0 22px #FF4FA3; }
.neon-2 { font-size: 31px; color: #FFE3F1; text-shadow: 0 0 8px #FF9F45, 0 0 24px #FF9F45; }
.pill { margin-top: 14px; align-self: flex-start; border: 1.5px solid var(--pink); background: var(--bg); color: var(--ink); font-size: 13px; font-weight: 800; padding: 7px 12px; border-radius: 6px; }
.main-body { flex: 1; padding: 14px 24px 22px; display: flex; flex-direction: column; gap: 14px; }
.main-steps { flex: 1; display: flex; flex-direction: column; justify-content: space-evenly; gap: 12px; }
.step { display: flex; gap: 12px; background: var(--card); border-radius: 16px; padding: 16px; }
.step.gold { border: 1.5px solid var(--gold); }
.step-n { flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--pink); color: var(--bg); display: flex; align-items: center; justify-content: center; font-family: var(--f-anton); font-size: 17px; }
.step.gold .step-n { background: var(--gold); }
.step-t { font-size: 15px; font-weight: 800; }
.step-d { font-size: 13px; line-height: 1.45; color: var(--mute); }
.step-d strong { color: var(--ink); }
.voucher-teaser { display: flex; gap: 12px; align-items: center; border: 1.5px dashed var(--orange); border-radius: 16px; padding: 14px 16px; }
.voucher-teaser b { flex: none; font-family: var(--f-anton); font-weight: 400; font-size: 26px; line-height: 1; color: var(--orange); }

/* ---------- 4 · Mon espace / en-têtes dégradés ---------- */
.hero-grad { flex: none; background: linear-gradient(180deg, #FF9F45 0%, #FF4FA3 60%, #6A2FB8 100%); padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.hero-sun { background: linear-gradient(180deg, #FFD36E 0%, #FF9F45 45%, #FF4FA3 100%); }
.hero-gold { background: linear-gradient(180deg, #FFD36E 0%, #FF9F45 50%, #C2408F 100%); }
.hero-tag { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--bg); }
.hero-name { font-size: 17px; font-weight: 800; color: var(--bg); }
.rank-btn { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 12px; background: var(--bg); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 700; flex: none; }
.rank-btn:hover { color: var(--ink); background: #22113F; }
.stat { background: var(--bg); border-radius: 16px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat span { font-size: 12px; color: var(--mute); }
.stat b { font-family: var(--f-anton); font-weight: 400; font-size: 34px; line-height: 1.1; white-space: nowrap; }
.lives-card { background: var(--card); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.insta {
  width: 100%; display: flex; align-items: center; gap: 12px; background: var(--bg); border: 1.5px solid var(--gold);
  border-radius: 14px; padding: 12px 14px; color: var(--ink); text-align: left; cursor: pointer; text-decoration: none;
}
.insta.done { border-color: var(--line); cursor: default; }
.insta-tag { font-size: 12px; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: 0.06em; }
.rdv { border: 1.5px solid var(--gold); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.rdv-t { font-family: var(--f-script); font-size: 24px; line-height: 1; color: var(--gold); }
.info-card { background: var(--card); border: 1.5px solid var(--gold); border-radius: 16px; padding: 14px 16px; font-size: 13px; line-height: 1.5; color: var(--mute); }
.info-card strong { color: var(--ink); }

/* ---------- 6 · Fin de partie ---------- */
.end-head { flex: none; padding: 22px 24px; display: flex; flex-direction: column; align-items: center; gap: 6px; background: #120c22; border-bottom: 1.5px solid var(--line); }
.siren { width: 14px; height: 14px; border-radius: 50%; }
.siren.r { background: #ff3b4f; box-shadow: 0 0 12px #ff3b4f; animation: sirenR 1s steps(2) infinite; }
.siren.b { background: #3b7bff; box-shadow: 0 0 12px #3b7bff; animation: sirenB 1s steps(2) infinite; }
@keyframes sirenR { 50% { opacity: 0.35; } }
@keyframes sirenB { 0% { opacity: 0.35; } 50% { opacity: 1; } }
.end-title { margin-top: 10px; font-family: var(--f-bungee); font-size: 40px; line-height: 1; color: var(--ink); text-shadow: 0 0 8px #ff3b4f, 0 0 22px #ff3b4f; text-align: center; }
.end-score { margin-top: 8px; font-family: var(--f-bungee); font-size: 64px; line-height: 1; white-space: nowrap; }
.record { padding: 3px 12px; border-radius: 999px; background: #ffb347; color: #2a1400; font-weight: 800; font-size: 13px; }
.tiles3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--card); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.tile b { font-family: var(--f-bungee); font-weight: 400; font-size: 20px; white-space: nowrap; }
.tile span { font-size: 12px; color: var(--mute2); }
.kv { background: var(--card); border-radius: 16px; padding: 4px 16px; }
.kv div { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv div:last-child { border-bottom: 0; }
.kv span { color: var(--mute); }
.kv b { font-weight: 800; }
.share { display: flex; align-items: center; gap: 12px; width: 100%; text-decoration: none; color: var(--ink); border: 1.5px solid var(--pink); border-radius: 14px; padding: 12px 14px; background: transparent; cursor: pointer; text-align: left; font-size: 13px; line-height: 1.4; }
.share:hover { color: var(--ink); background: rgba(255, 79, 163, 0.08); }

/* ---------- 7 · Classement ---------- */
.lb { display: flex; flex-direction: column; gap: 6px; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; background: var(--card); border: 1.5px solid var(--card); }
.lb-row.me { background: #3A1440; border-color: var(--pink); }
.lb-row.gap { margin-top: 10px; }
.lb-rank { flex: none; min-width: 30px; height: 30px; padding: 0 4px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-family: var(--f-anton); font-size: 16px; background: var(--line); color: var(--ink); }
.lb-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-pts { font-size: 14px; font-weight: 800; white-space: nowrap; }
.cd { display: flex; gap: 6px; }
.cd div { display: flex; flex-direction: column; align-items: center; min-width: 44px; padding: 6px 4px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.cd b { font-family: var(--f-anton); font-weight: 400; font-size: 22px; line-height: 1.05; color: var(--orange); }
.cd span { font-size: 10px; color: var(--mute2); }
.prize-card { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1.5px solid var(--pink); border-radius: 16px; padding: 10px 14px; font-size: 13px; line-height: 1.4; color: var(--mute); }
.prize-card strong { color: var(--ink); }
.prize-card img { flex: none; object-fit: contain; }

/* ---------- 8 · Bon d'achat ---------- */
.hero-script { margin-top: 6px; font-family: var(--f-script); font-size: 32px; line-height: 1; color: var(--bg); }
.hero-big { font-family: var(--f-anton); font-size: 48px; line-height: 0.98; color: var(--ink); text-transform: uppercase; }
.voucher { background: var(--ink); color: var(--bg); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.voucher .dash { height: 1px; background: repeating-linear-gradient(90deg, #B6A6D0 0 6px, transparent 6px 12px); }
.voucher small { font-size: 12px; line-height: 1.45; color: #4A3D60; }
.code { font-family: var(--f-anton); font-size: 26px; letter-spacing: 0.06em; }
.ph-box { border: 2px dashed #6E5F86; border-radius: 8px; display: flex; align-items: center; justify-content: center; text-align: center; color: #4A3D60; flex: none; }
.bar { height: 10px; border-radius: 5px; background: var(--off); overflow: hidden; }
.bar i { display: block; height: 10px; border-radius: 5px; background: var(--orange); }

/* ---------- 9 · Jour J ---------- */
.ranks10 { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.ranks10 div { height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-family: var(--f-anton); font-size: 13px; background: var(--line); color: var(--mute2); }
.ranks10 .w { background: var(--pink); color: var(--bg); }
.ranks10 .g { background: var(--gold); color: var(--bg); }
.ranks10 .me { outline: 2px solid var(--ink); outline-offset: 1px; }

/* ---------- Dialogue avec le serveur : attente, erreurs, statut du score ---------- */
.attente { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 40px 24px; text-align: center; color: var(--mute); font-size: 14px; }
.rond { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--pink); animation: tourne 0.9s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.erreur-carte { background: var(--card); border: 1.5px solid var(--err); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; line-height: 1.5; color: var(--ink); }
.statut { border-radius: 12px; padding: 10px 14px; font-size: 13px; line-height: 1.45; text-align: center; background: var(--card); color: var(--mute); }
.statut.ok { color: var(--teal); }
.statut.alerte { border: 1.5px solid var(--orange); color: var(--ink); }
.statut.err { border: 1.5px solid var(--err); color: var(--ink); }
.btn-lien { align-self: center; background: none; border: 0; padding: 6px; color: var(--pink2); font-family: inherit; font-size: 13px; font-weight: 700; text-decoration: underline; cursor: pointer; }
.btn-lien:hover { color: #FFB3D7; }
/* Partage sans navigator.share : texte à sélectionner (le presse-papiers est bloqué pour la page) */
.partage-texte { margin: 0; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); font-size: 14px; line-height: 1.5; color: var(--ink); -webkit-user-select: all; user-select: all; }
/* Code du jour J saisi à la main, si le QR code ne s'ouvre pas */
.input.code { text-transform: uppercase; letter-spacing: 0.2em; font-weight: 800; }

@media (prefers-reduced-motion: reduce) {
  .sun, .sun-top, .sun-bottom, .band, .siren, .screen.enter, .toast, .sheet-card { animation: none !important; }
  .rond { animation-duration: 3s; }
}
