/* public/dashboard/styles/game.css — LE JEU (spec 2026-11-06 § 5.4, la peau de la maquette) : la capsule de la cagnotte,
   l'écran Cagnotte, le bilan d'Appeler, « Maintenant » en bloc or (Piloter, Ma tournée) et la carte du prochain RDV.
   Tout vient des jetons de la peau (tokens.css, § 5.1 : --pot la cagnotte et ce qui presse, --on-pot son encre,
   --pot-soft le fond d'un bloc or, --money l'argent gagné, --font-display les chiffres, les rayons), de nuit comme de jour.
   Lue après apps.css : ses règles l'emportent sur les anciennes `.app-prize-*`. Les animations ne jouent que sans
   `prefers-reduced-motion`. */

.app-prize, .app-prize-capsule, .app-now, .app-bilan, .app-tour-next {
  --game-num: var(--font-display, var(--font-family));
  --game-pot-bg: var(--pot-soft);
  --game-pot-line: color-mix(in srgb, var(--pot) 42%, transparent);
  --game-money-bg: var(--money-soft);
  --game-track: color-mix(in srgb, var(--text) 14%, transparent);
}

/* ---------- La capsule (en haut d'Appeler) ---------- */
.app-prize-capsule-slot:empty { display: none; }
.app-prize-capsule {
  display: inline-flex; align-items: center; gap: 12px; min-height: var(--target-min, 44px); box-sizing: border-box;
  padding: 10px 16px 10px 12px; border-radius: var(--radius); color: var(--text); text-decoration: none; font-weight: 400;
  background: var(--panel); border: 1px solid var(--border);
}
.app-prize-capsule-pot { background: var(--game-pot-bg); border-color: var(--game-pot-line); }
.app-prize-capsule:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.app-prize-coin { flex: none; width: 30px; height: 30px; fill: none; stroke: var(--pot); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.app-prize-capsule-text { display: flex; flex-direction: column; gap: 2px; }
.app-prize-capsule-kicker { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.app-prize-capsule-pot .app-prize-capsule-kicker { color: var(--pot); }
.app-prize-capsule-amount { font-family: var(--game-num); font-size: 26px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--money); }
.app-prize-capsule-pot .app-prize-capsule-amount { color: var(--pot); }
.app-prize-capsule-line { font-size: 12px; color: var(--muted); }

/* ---------- L'écran Cagnotte ---------- */
/* Téléphone (≤ 720 px) : une colonne qui défile ; tablette : une colonne de 640 px au plus ; ordinateur : deux colonnes
   (le bloc or, le compte à rebours, le podium ; ma place, les ligues, les défis) qui tiennent en 1 440 × 900. Jusqu'à
   1 024 px, les deux colonnes se fondent pour suivre l'ordre de la maquette (ligues avant le podium). */
.app-prize { display: grid; gap: 14px; max-width: 640px; margin: 0 auto; padding: 4px 0 16px; }
.app-prize-main, .app-prize-side { display: contents; }
.app-prize-hero { order: 1; }
.app-prize-leagues { order: 2; }
.app-prize-podium, .app-prize-nobody { order: 3; }
.app-prize-mine { order: 4; }
.app-prize-challenges { order: 5; }
.app-prize-side > h3, .app-prize-missions, .app-prize-merit, .app-prize-optin { order: 6; }
@media (min-width: 1025px) {
  .app-prize { max-width: 1120px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; gap: 16px 28px; }
  .app-prize-main, .app-prize-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
}


.app-prize-hero {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px; text-align: center;
  border-radius: var(--radius-lg); background: var(--game-pot-bg); border: 1px solid var(--game-pot-line);
}
.app-prize-kicker { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--pot); }
.app-prize .app-prize-amount { margin: 0; font-family: var(--game-num); font-size: clamp(44px, 9vw, 64px); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--pot); }
.app-prize-shared, .app-prize-closed { margin: 0; font-size: 14px; color: var(--muted); }
.app-prize-closed { font-size: 16px; font-weight: 700; color: var(--text); }

.app-prize-countdown { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 6px; }
.app-prize-countdown:empty { display: none; }
.app-prize-countdown-label { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.app-prize-countdown-over { margin: 0; font-weight: 700; }
.app-prize-cell {
  display: flex; flex-direction: column; align-items: center; min-width: 56px; padding: 6px 8px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--pot) 20%, var(--panel));
}
.app-prize-cell strong { font-family: var(--game-num); font-size: 20px; font-variant-numeric: tabular-nums; }
.app-prize-cell span { font-size: 12px; color: var(--muted); }

/* Les ligues : un sélecteur segmenté. */
.app-prize .app-prize-leagues {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; padding: 4px;
  border-radius: var(--radius); background: var(--panel-2, var(--panel));
}
.app-prize-leagues button {
  min-height: var(--target-min, 44px); border: 0; border-radius: 10px; background: transparent; color: var(--text);
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.app-prize .app-prize-leagues button[aria-pressed="true"] { background: var(--pot); color: var(--on-pot); font-weight: 800; border: 0; }
.app-prize-leagues button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* Le podium : trois marches, le 1er au centre et plus haut. */
.app-prize .app-prize-podium { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; }
.app-prize-step {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; box-sizing: border-box;
  padding: 12px 6px; border-radius: 16px 16px 8px 8px; background: var(--panel-2, var(--panel)); border: 1px solid var(--border); text-align: center;
}
.app-prize-step-1 { order: 2; min-height: 140px; background: var(--game-pot-bg); border-color: var(--pot); }
.app-prize-step-2 { order: 1; min-height: 112px; }
.app-prize-step-3 { order: 3; min-height: 98px; }
.app-prize-step-place { font-size: 13px; color: var(--muted); }
.app-prize-step-1 .app-prize-step-place { font-weight: 800; color: var(--pot); }
.app-prize-step-name { font-size: 15px; overflow-wrap: anywhere; }
.app-prize-step-value { font-family: var(--game-num); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.app-prize-step-1 .app-prize-step-value { font-size: 20px; color: var(--pot); }

/* Ma place : la carte verte et sa barre vers le podium. */
.app-prize .app-prize-mine {
  display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 12px 14px; font-weight: 400;
  border-radius: var(--radius); background: var(--game-money-bg); border: 1px solid var(--money);
}
.app-prize-mine-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.app-prize-mine-head strong { font-size: 16px; }
.app-prize-mine-value { font-size: 14px; color: var(--muted); }
.app-prize-mine-text { margin: 0; font-size: 14px; }

/* Les barres : celle de ma place en vert, celles des défis en or. */
.app-prize progress { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: var(--radius-pill); background: var(--game-track); overflow: hidden; }
.app-prize progress::-webkit-progress-bar { background: var(--game-track); border-radius: var(--radius-pill); }
.app-prize progress::-webkit-progress-value { background: var(--pot); border-radius: var(--radius-pill); }
.app-prize progress::-moz-progress-bar { background: var(--pot); border-radius: var(--radius-pill); }
.app-prize-mine progress::-webkit-progress-value { background: var(--money); }
.app-prize-mine progress::-moz-progress-bar { background: var(--money); }

.app-prize .app-prize-challenges { display: flex; flex-direction: column; gap: 8px; }
.app-prize-challenges h3, .app-prize-side > h3 { margin: 4px 0 0; font-size: 15px; }
.app-prize .app-prize-challenge { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--radius); background: var(--panel-2, var(--panel)); border: 1px solid var(--border); }
.app-prize-challenge-head { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 700; }
.app-prize-challenge-prize { color: var(--pot); }
.app-prize-challenge-foot { display: flex; align-items: center; gap: 8px; font-size: 13px; }

.app-prize .app-prize-missions { margin: 0; padding-left: 18px; display: grid; gap: 10px; }
.app-prize .app-prize-mission { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.app-prize .app-prize-mission-rule { margin: 0; font-size: 12px; line-height: 1.45; order: 6; }
.app-prize .app-prize-merit { margin: 0; font-size: 12px; font-weight: 400; line-height: 1.45; color: var(--muted); }
.app-prize-optin summary { min-height: var(--target-min, 44px); display: flex; align-items: center; font-weight: 700; cursor: pointer; }

/* ---------- « Maintenant » : le bloc or et son seul bouton plein ---------- */
.app-now {
  align-self: stretch; display: flex; flex-direction: column; gap: 10px; padding: 14px;
  border-radius: var(--radius); background: var(--game-pot-bg); border: 1px solid var(--game-pot-line);
}
.app-now-kicker { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--pot); }
.app-now-line { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); }
.app-now .app-tour-address { margin: 0; font-size: 14px; font-weight: 400; color: var(--muted); }
.app-now .ui-btn.ui-btn-primary {
  min-height: 52px; border-radius: var(--radius); border: 0; background: var(--pot); color: var(--on-pot);
  font-weight: 800; text-decoration: none;
}
.app-now .ui-btn.ui-btn-primary:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* Les boutons de Ma tournée : « Naviguer » et « Appeler le client » côte à côte, jamais des liens soulignés. */
.app-tour-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.app-tour-actions > .ui-btn { flex: 1 1 140px; justify-content: center; min-height: 48px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 700; }
.app-tour-next { align-self: stretch; display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--radius); background: var(--panel-2, var(--panel)); border: 1px solid var(--border); }
.app-tour-next-when { margin: 0; font-size: 16px; font-weight: 800; }
.app-tour-next .app-tour-address { margin: 0; font-size: 13px; font-weight: 400; color: var(--muted); }

/* ---------- Le bilan d'Appeler, au retour de l'appel ---------- */
.app-bilan { align-self: stretch; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.app-bilan p { margin: 0; }
.app-bilan-amount { font-family: var(--game-num); font-size: 56px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--money); }
.app-bilan-amount-word { font-size: 32px; }
.app-bilan-sub { font-size: 14px; color: var(--muted); }
.app-bilan-podium { font-size: 15px; line-height: 1.45; }
.app-bilan > .ui-btn { align-self: stretch; }

@media (prefers-reduced-motion: no-preference) {
  .app-bilan-amount { animation: game-pop .5s ease-out both; }
  .app-prize-step { animation: game-rise .4s ease-out both; }
  .app-prize-step-1 { animation-delay: .08s; }
  .app-prize-step-3 { animation-delay: .16s; }
}
@keyframes game-pop { 0% { transform: scale(.7); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes game-rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
