/* ============================================================================
   Labo attelage — C1 « Remets dans l'ordre » (27/11) : styles .ord-* (assets/attelage-ordre.js)
   et pictogrammes partagés .pic-svg (assets/attelage-pictos.js). Jetons de l'appli (app.css).
   ========================================================================== */
.pic-svg { display: block; width: 100%; height: 100%; color: var(--encre, #0B1F3A); }

.ord { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 28px; max-width: 560px; margin: 0 auto; position: relative; }
.ord-h { font-size: 1.45rem; font-weight: 800; text-align: center; }
.ord-sous { font-weight: 800; color: var(--muted, #46566B); font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }
.ord-record { font-weight: 800; text-align: center; color: var(--bleu-fonce, #073F94); }

/* choix de la procédure : 2 × 2 tuiles */
.ord-procs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ord-proc { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 112px; padding: 10px 6px;
  background: var(--carte, #fff); border: 3px solid var(--trait, #C9D3E1); border-radius: 14px; box-shadow: 0 4px 0 var(--trait, #C9D3E1); font: inherit; color: var(--encre, #0B1F3A); }
.ord-proc .pic-svg { width: 44px; height: 44px; }
.ord-proc__t { font-weight: 800; font-size: .98rem; line-height: 1.15; text-align: center; }
.ord-proc__s { font-size: .8rem; font-weight: 600; color: var(--muted, #46566B); }
.ord-proc.is-choisi { border-color: var(--encre, #0B1F3A); background: var(--jaune-pale, #FFF4C2); box-shadow: 0 4px 0 var(--encre, #0B1F3A); }

/* niveaux */
.ord-niveaux { display: flex; flex-direction: column; gap: 8px; }
.ord-niv { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 12px; text-align: left;
  background: var(--carte, #fff); border: 3px solid var(--trait, #C9D3E1); border-radius: 14px; font: inherit; color: var(--encre, #0B1F3A); }
.ord-niv.is-choisi { border-color: var(--encre, #0B1F3A); background: var(--jaune-pale, #FFF4C2); }
.ord-niv__n { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.2rem;
  background: var(--bleu, #0B5ED7); color: #fff; }
.ord-niv.is-choisi .ord-niv__n { background: var(--encre, #0B1F3A); color: var(--jaune, #FFCC00); }
.ord-niv__tx { display: flex; flex-direction: column; }
.ord-niv__t { font-weight: 800; }
.ord-niv__s { font-size: .86rem; font-weight: 600; color: var(--muted, #46566B); }
.ord-facile { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 10px; text-align: left; font: inherit; font-weight: 700;
  background: transparent; border: 0; color: var(--encre, #0B1F3A); }
.ord-facile__case { flex: none; width: 30px; height: 30px; border: 3px solid var(--encre, #0B1F3A); border-radius: 8px; display: grid; place-items: center; font-weight: 900; background: var(--carte, #fff); }
.ord-facile.is-on .ord-facile__case { background: var(--vert, #00843D); color: #fff; border-color: var(--vert-fonce, #005A29); }
.ord-go { margin-top: 6px; }

/* en-tête du jeu */
.ord-haut { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ord-haut__t { font-weight: 800; font-size: 1.05rem; }
.ord-chrono { flex: none; font-weight: 800; font-variant-numeric: tabular-nums; background: var(--encre, #0B1F3A); color: var(--jaune, #FFCC00); border-radius: 8px; padding: 2px 10px; }
.ord-consigne { font-weight: 700; color: var(--bleu-fonce, #073F94); }

/* les cartes */
.ord-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ord-carte { position: relative; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 10px 6px 6px; width: 100%;
  background: var(--carte, #fff); border: 3px solid var(--encre, #0B1F3A); border-radius: 14px; box-shadow: 0 3px 0 var(--trait, #C9D3E1);
  font: inherit; color: var(--encre, #0B1F3A); text-align: left; transition: transform .18s ease, background .2s, border-color .2s;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.ord-liste.is-glisse .ord-carte { touch-action: none; cursor: grab; }
.ord-liste.is-glisse.is-corrige .ord-carte { touch-action: manipulation; cursor: pointer; }
.ord-carte__rang { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: .95rem;
  background: var(--fond, #EEF3FA); border: 2px solid var(--trait, #C9D3E1); }
.ord-carte__pic { flex: none; width: 40px; height: 40px; }
.ord-carte__t { flex: 1; min-width: 0; font-weight: 700; font-size: .95rem; line-height: 1.2; overflow-wrap: anywhere; }
.ord-carte__place { flex: none; font-weight: 900; color: var(--rouge-fonce, #8E0A13); font-size: 1rem; }
.ord-carte.is-leve { z-index: 5; transition: background .2s; box-shadow: 0 12px 24px rgba(11, 31, 58, .3); background: var(--jaune-pale, #FFF4C2); cursor: grabbing; }
.ord-liste.is-glisse-en-cours { cursor: grabbing; }
.ord-carte.is-ok { border-color: var(--vert, #00843D); background: var(--vert-pale, #E1F5E8); }
.ord-carte.is-ok .ord-carte__rang { background: var(--vert, #00843D); border-color: var(--vert-fonce, #005A29); color: #fff; }
.ord-carte.is-ok .ord-carte__place { color: var(--vert-fonce, #005A29); }
.ord-carte.is-faux { border-color: var(--rouge, #D4111E); background: var(--rouge-pale, #FDE6E8); }
.ord-carte.is-faux .ord-carte__rang { background: var(--rouge, #D4111E); border-color: var(--rouge-fonce, #8E0A13); color: #fff; }
.ord-carte.is-secoue { animation: ord-secoue .45s; }
.ord-carte.is-arrive { animation: ord-arrive .3s cubic-bezier(.3, 1.5, .5, 1); }
.ord-carte.is-revele { border-color: var(--jaune-fonce, #A88600); background: var(--jaune-pale, #FFF4C2); }
.ord-carte.is-mini { min-height: 46px; box-shadow: none; border-width: 2px; }
.ord-carte.is-mini .ord-carte__pic { width: 32px; height: 32px; }
.ord-carte.is-mini .ord-carte__t { font-size: .88rem; }
@keyframes ord-secoue { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(4px); } }
@keyframes ord-arrive { from { transform: scale(.85); opacity: .4; } to { transform: none; opacity: 1; } }

/* facile : places vides + pioche */
.ord-vide, .ord-trou { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px; border: 3px dashed var(--trait, #C9D3E1); border-radius: 14px; }
.ord-pose { list-style: none; }
.ord-vide.is-suivante { border-color: var(--bleu, #0B5ED7); background: var(--bleu-pale, #E4EEFF); }
.ord-reserve { display: flex; flex-direction: column; gap: 8px; }
.ord-carte.is-pioche .ord-carte__rang { visibility: hidden; width: 0; margin-right: -10px; }
.ord-sous--pioche { margin-top: 2px; }

/* niveau 3 */
.ord-liste.is-mini { gap: 6px; }
.ord-trou { min-height: 46px; border-color: var(--jaune-fonce, #A88600); background: var(--jaune-pale, #FFF4C2); }
.ord-trou__q { font-weight: 900; font-size: 1.3rem; }
.ord-choix { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.ord-rep { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 12px; text-align: left; font: inherit; font-weight: 800;
  background: var(--carte, #fff); border: 3px solid var(--encre, #0B1F3A); border-radius: 14px; box-shadow: 0 4px 0 var(--encre, #0B1F3A); color: var(--encre, #0B1F3A); }
.ord-rep:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--encre, #0B1F3A); }
.ord-rep .ord-carte__pic { width: 46px; height: 46px; }
.ord-rep.is-ok { background: var(--vert-pale, #E1F5E8); border-color: var(--vert, #00843D); box-shadow: 0 4px 0 var(--vert-fonce, #005A29); }
.ord-rep.is-faux { background: var(--rouge-pale, #FDE6E8); border-color: var(--rouge, #D4111E); box-shadow: 0 4px 0 var(--rouge-fonce, #8E0A13); }
.ord-rep.is-secoue { animation: ord-secoue .45s; }
.ord-retour { font-weight: 800; padding: 8px 12px; border-radius: 12px; }
.ord-retour.is-ok { background: var(--vert-pale, #E1F5E8); color: var(--vert-fonce, #005A29); }
.ord-retour.is-faux { background: var(--rouge-pale, #FDE6E8); color: var(--rouge-fonce, #8E0A13); }

/* bilan */
.ord-bilan { padding: 10px 12px; border-radius: 12px; background: var(--bleu-pale, #E4EEFF); border: 2px solid var(--bleu-trait, #9EC1F5); }
.ord-bilan.is-ok { background: var(--vert-pale, #E1F5E8); border-color: var(--vert, #00843D); color: var(--vert-fonce, #005A29); animation: ord-arrive .35s; }
.ord-bilan.is-faux { background: var(--rouge-pale, #FDE6E8); border-color: var(--rouge-trait, #F2A5AB); color: var(--rouge-fonce, #8E0A13); }
.ord-bilan__t { font-weight: 800; font-size: 1.1rem; }
.ord-bilan__s { font-weight: 600; font-size: .9rem; margin-top: 2px; }
.ord-actions { display: flex; flex-direction: column; gap: 4px; position: sticky; bottom: 0; padding-top: 6px; background: linear-gradient(transparent, var(--fond, #EEF3FA) 18%); }

/* feuille « Détail » */
.ord-feuille { position: fixed; inset: 0; z-index: 60; background: rgba(11, 31, 58, .55); display: flex; align-items: flex-end; justify-content: center; }
.ord-feuille__boite { width: 100%; max-width: 560px; max-height: 86vh; overflow-y: auto; background: var(--carte, #fff); border-radius: 20px 20px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 6px; animation: ord-monte .25s ease-out; }
@keyframes ord-monte { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.ord-feuille__haut { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.ord-feuille__haut .pic-svg { width: 56px; height: 56px; flex: none; }
.ord-feuille__n { font-size: .8rem; font-weight: 800; color: var(--muted, #46566B); text-transform: uppercase; letter-spacing: .05em; }
.ord-feuille__t { font-size: 1.15rem; font-weight: 800; line-height: 1.2; }
.ord-feuille__l { font-weight: 800; font-size: .85rem; color: var(--bleu-fonce, #073F94); text-transform: uppercase; letter-spacing: .04em; margin-top: 6px; }
.ord-feuille__p { font-weight: 600; line-height: 1.4; }
.ord-feuille__secu { background: var(--jaune-pale, #FFF4C2); border-left: 5px solid var(--jaune, #FFCC00); padding: 6px 10px; border-radius: 6px; }
.ord-feuille__val { font-size: .85rem; font-weight: 700; color: var(--muted, #46566B); }
.ord-feuille .btn { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  .ord-carte, .ord-carte.is-secoue, .ord-carte.is-arrive, .ord-rep.is-secoue, .ord-feuille__boite, .ord-bilan.is-ok { animation: none !important; transition: none !important; }
}
