/* Écran barista : tablette paysage 1180 × 820 */

.scene-tablette { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 16px 24px 24px; }

/* Retour vers l'appli, au-dessus de la tablette */
.barre-retour { width: calc(1212px * var(--e, 1)); display: flex; align-items: center; gap: 16px; flex: none; }
.retour-appli {
  display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 20px 0 14px; border-radius: var(--r-rond);
  background: var(--surface); box-shadow: var(--ombre-carte); color: var(--encre);
  font-size: 17px; font-weight: 700; text-decoration: none; flex: none;
  transition: transform .16s var(--courbe);
}
.retour-appli:active { transform: scale(.97); }
.retour-appli .ico { width: 20px; height: 20px; }
.barre-retour .secondaire { font-size: 15px; }
.tablette-boite { width: calc(1212px * var(--e, 1)); height: calc(852px * var(--e, 1)); }

/* Même échelle d'arrondis que l'appli (styles.css) : blocs 36, petit 20, mini 12, ronds.
   La tablette s'y adapte : écran 36 + 16 = 52, cadre 52 + 16 = 68 */
:root {
  --r-tablette: 68px;
  --r-ecran-tablette: 52px;
}
.tablette {
  width: 1212px; height: 852px; padding: 16px; border-radius: var(--r-tablette);
  background: linear-gradient(145deg, #3a3a3e, #1c1c1f 40%, #2c2c30);
  box-shadow: 0 0 0 2px #55555b, 0 30px 60px -20px rgba(20, 38, 74, .35);
  transform: scale(var(--e, 1)); transform-origin: top left;
}
.tablette-ecran {
  position: relative; width: 1180px; height: 820px; border-radius: var(--r-ecran-tablette); overflow: clip;
  background: var(--fond); display: flex; flex-direction: column; padding: 16px 16px 0;
}

@media (max-width: 900px), (max-height: 520px) {
  .scene-tablette { padding: 0; display: block; }
  .barre-retour { width: 100%; height: 64px; padding: max(8px, env(safe-area-inset-top)) 16px 0; }
  .barre-retour .secondaire { display: none; }
  .tablette-boite, .tablette { width: 100%; height: calc(100dvh - 64px); }
  .tablette { padding: 0; border-radius: 0; background: none; box-shadow: none; transform: none; }
  .tablette-ecran { width: 100%; height: calc(100dvh - 64px); border-radius: 0; padding: 8px 16px 0; }
}

/* ---------- En-tête du comptoir ---------- */

.comptoir-tete {
  display: flex; align-items: center; gap: 12px; height: 88px; padding: 16px; border-radius: var(--r-bloc);
  background: var(--surface); box-shadow: var(--ombre-carte); flex: none;
}
.comptoir-tete img { width: 48px; height: 48px; }
.comptoir-tete .titre { display: flex; flex-direction: column; margin-right: auto; }
.comptoir-tete .titre strong { font-size: 26px; line-height: 30px; font-weight: 800; }
.comptoir-tete .titre .secondaire { font-size: 15px; line-height: 20px; }

/* Les pastilles de l'en-tête font toutes 56 de haut, à 16 du bord : 36 − 16 = 20 */
.maree-comptoir, .bouton-ruptures, .comptoir-tete .horloge { height: 56px; border-radius: var(--r-petit); display: flex; align-items: center; }
.maree-comptoir { gap: 10px; padding: 0 16px 0 12px; background: var(--brume-100); }
.maree-comptoir > span { display: flex; flex-direction: column; font-size: 14px; line-height: 18px; font-weight: 600; color: var(--encre-douce); }
.maree-comptoir b { font-size: 17px; line-height: 21px; font-weight: 800; color: var(--encre); }
/* Marée du comptoir : haute en terracotta, montante en soleil, basse en brume */
.maree-comptoir.haute { background: var(--terracotta-100); }
.maree-comptoir.haute .ico { color: var(--terracotta-700); }
.maree-comptoir.montante { background: #FBEFD3; }
.maree-comptoir.montante .ico { color: #8A6414; }
.maree-comptoir.calme .ico { color: var(--marine-500); }

.bouton-ruptures { gap: 8px; padding: 0 12px; background: var(--sable-200); font-size: 17px; font-weight: 700; }
.bouton-ruptures b { min-width: 28px; height: 28px; padding: 0 8px; border-radius: var(--r-rond); display: grid; place-items: center; background: var(--brique-700); color: var(--sable-50); font-size: 15px; }
.bouton-ruptures:active { transform: scale(.97); }
.comptoir-tete .horloge { padding: 0 8px 0 4px; font-size: 32px; font-weight: 800; }

/* ---------- Deux colonnes : à préparer, au comptoir ---------- */

.colonnes { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 344px; gap: 16px; padding-top: 24px; }
.colonnes > section { display: flex; flex-direction: column; min-height: 0; }
/* Le titre de colonne s'aligne sur le texte des cartes (marge 16 + 8) */
.colonne-tete { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 24px; margin-bottom: 12px; }
.colonne-tete h2 { font-size: 22px; line-height: 28px; font-weight: 800; }
.colonne-tete .nb { min-width: 32px; height: 32px; padding: 0 10px; border-radius: var(--r-rond); display: grid; place-items: center; background: var(--marine-800); color: var(--sable-50); font-size: 17px; font-weight: 800; }
.colonne-tete .nb.vert { background: var(--algue-700); }
.colonne-tete .secondaire { margin-left: auto; font-size: 15px; }
.defile-comptoir { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 16px; scrollbar-width: none; }
.defile-comptoir::-webkit-scrollbar { display: none; }

/* Commande à préparer : carte 36, marge 16 → bouton et lignes 20 */
.commande {
  display: flex; align-items: stretch; gap: 16px; padding: 16px;
  border-radius: var(--r-bloc); background: var(--surface); box-shadow: var(--ombre-carte);
  flex: none;
}
.commande.appli { box-shadow: inset 0 0 0 2px var(--terracotta-200); }
.commande.arrive { box-shadow: inset 0 0 0 2px var(--terracotta-500); animation: arrive .6s var(--courbe); }
@keyframes arrive { 0% { transform: translateY(12px); opacity: 0; } 60% { transform: scale(1.01); } }
.commande .quand { width: 112px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; flex: none; padding: 8px 0 8px 8px; }
.commande .quand strong { font-size: 30px; line-height: 36px; font-weight: 800; }
.commande .quand span { height: 28px; display: inline-flex; align-items: center; font-size: 15px; font-weight: 700; color: var(--encre-douce); }
.commande .quand.proche span { padding: 0 10px; margin-left: -10px; border-radius: var(--r-rond); background: var(--terracotta-100); color: var(--terracotta-700); }
.commande .qui { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.commande .nom { display: flex; align-items: center; gap: 10px; font-size: 26px; line-height: 36px; font-weight: 800; }
.commande .nom em { font-style: normal; color: var(--terracotta-700); }
.pastille-appli { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border-radius: var(--r-rond); background: var(--terracotta-100); color: var(--terracotta-700); font-size: 14px; font-weight: 800; }
.boissons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
/* Chaque boisson se coche quand elle est faite : ligne 20, marge 8 → case 12 */
.boisson-ligne { width: 100%; height: 56px; display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; border-radius: var(--r-petit); background: var(--sable-100); font-size: 20px; line-height: 26px; font-weight: 600; text-align: left; transition: background .16s; }
.boisson-ligne .case { width: 40px; height: 40px; border-radius: var(--r-mini); flex: none; display: grid; place-items: center; box-shadow: inset 0 0 0 2px var(--marine-400); background: var(--surface); }
.boisson-ligne.faite { background: var(--algue-100); color: var(--encre-douce); }
.boisson-ligne.faite > span:last-child { text-decoration: line-through; text-decoration-thickness: 2px; }
.boisson-ligne.faite .case { background: var(--algue-700); box-shadow: none; color: var(--sable-50); }
.avec-boutique { display: flex; align-items: center; gap: 8px; min-height: 28px; padding-left: 6px; font-size: 16px; font-weight: 600; color: var(--encre-douce); }

.bouton-prete {
  width: 160px; border-radius: var(--r-petit); flex: none; min-height: 104px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--action); color: var(--sur-action); font-size: 24px; font-weight: 800;
  transition: transform .16s var(--courbe), background .16s;
}
.bouton-prete:active { transform: scale(.97); background: var(--marine-600); }
.bouton-prete .ico { width: 28px; height: 28px; }
.bouton-prete.pret { background: var(--algue-700); }

.vide-comptoir { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 32px 24px; border-radius: var(--r-bloc); background: var(--surface); box-shadow: var(--ombre-carte); }
.vide-comptoir img { width: 200px; margin-bottom: 8px; }
.vide-comptoir strong { font-size: 24px; font-weight: 800; }
.vide-comptoir span { max-width: 380px; font-size: 18px; color: var(--encre-douce); }

/* Colonne « Au comptoir » : carte 36, marge 16 → bouton 20 */
.servie { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r-bloc); background: var(--algue-100); flex: none; }
.servie .qui { display: flex; flex-direction: column; gap: 2px; padding: 4px 8px 0; }
.servie .nom { font-size: 22px; line-height: 28px; font-weight: 800; }
.servie .nom em { font-style: normal; color: var(--algue-700); }
.servie .qui span { font-size: 16px; line-height: 22px; color: var(--encre-douce); }
.bouton-remise { display: flex; align-items: center; justify-content: center; gap: 8px; height: 56px; border-radius: var(--r-petit); background: var(--algue-700); color: var(--sable-50); font-size: 18px; font-weight: 800; }
.bouton-remise:active { transform: scale(.97); }
.vide-petit { padding: 16px 20px; border-radius: var(--r-bloc); background: var(--surface); box-shadow: var(--ombre-carte); font-size: 16px; line-height: 22px; color: var(--encre-douce); }
.colonne-comptoir h3 { margin: 12px 24px 0; font-size: 13px; line-height: 18px; }
.remises { list-style: none; margin: 0; padding: 0 24px; display: flex; flex-direction: column; gap: 10px; }
.remises li { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; line-height: 20px; color: var(--encre-douce); }
.remises li .ico { color: var(--algue-700); margin-top: 1px; }
.remises b { color: var(--encre); }

/* Message en bas : bloc 36, marge 8 → bouton 28 (pilule de 48) */
.toast-comptoir {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 20;
  display: flex; align-items: center; gap: 12px; height: 64px; padding: 8px 8px 8px 20px; border-radius: var(--r-bloc);
  background: var(--marine-800); color: var(--sable-50); font-size: 18px; white-space: nowrap;
  animation: toast .3s var(--courbe);
}
.toast-comptoir:not(:has(button)) { padding-right: 24px; }
.toast-comptoir.ok .ico { color: #7FD3AE; }
.toast-comptoir.nouvelle { background: var(--terracotta-700); }
.toast-comptoir button { height: 48px; padding: 0 20px; border-radius: var(--r-interne); background: var(--sable-50); color: var(--encre); font-size: 17px; font-weight: 800; }
@keyframes toast { from { transform: translate(-50%, 24px); opacity: 0; } }

/* Panneau des ruptures : posé à 16 du bord de l'écran (52 − 16 = 36) */
.voile-comptoir { position: absolute; inset: 0; z-index: 30; background: var(--voile); }
.voile-comptoir.entre { animation: fondu .2s; }
.panneau-ruptures {
  position: absolute; top: 16px; right: 16px; bottom: 16px; z-index: 31; width: 420px;
  display: flex; flex-direction: column; padding: 16px; border-radius: var(--r-bloc); background: var(--fond);
}
.panneau-ruptures.entre { animation: panneau .3s var(--courbe); }
@keyframes panneau { from { transform: translateX(calc(100% + 16px)); } }
.panneau-tete { display: flex; gap: 12px; align-items: flex-start; padding: 4px 0 0 8px; margin-bottom: 16px; }
.panneau-tete > div { flex: 1; }
.panneau-tete h2 { font-size: 28px; line-height: 34px; font-weight: 800; }
.panneau-tete .secondaire { margin-top: 4px; font-size: 16px; line-height: 22px; }
.bouton-fermer { width: 48px; height: 48px; border-radius: var(--r-rond); flex: none; display: grid; place-items: center; background: var(--surface); box-shadow: var(--ombre-carte); margin: -4px 0 0; }
/* Liste groupée façon iOS, à 16 du bord du panneau : 36 − 16 = 20 */
.liste-ruptures { list-style: none; margin: 0; padding: 0; border-radius: var(--r-petit); background: var(--surface); box-shadow: var(--ombre-carte); overflow-y: auto; overflow-x: clip; scrollbar-width: none; }
.liste-ruptures::-webkit-scrollbar { display: none; }
.liste-ruptures li + li .ligne-rupture { box-shadow: inset 0 1px 0 var(--ligne); }
.ligne-rupture { width: 100%; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 16px 0 20px; text-align: left; }
.ligne-rupture .textes { flex: 1; display: flex; flex-direction: column; }
.ligne-rupture strong { font-size: 18px; line-height: 22px; font-weight: 800; }
.ligne-rupture .textes span { font-size: 15px; line-height: 20px; font-weight: 600; color: var(--algue-700); }
.ligne-rupture.epuisee { background: var(--brique-100); }
.ligne-rupture.epuisee .textes span { color: var(--brique-700); }

/* Petit écran (téléphone) : tout s'empile */
@media (max-width: 900px) {
  .comptoir-tete { flex-wrap: wrap; height: auto; gap: 8px; padding: 12px; }
  .comptoir-tete .horloge { font-size: 26px; }
  .maree-comptoir, .bouton-ruptures, .comptoir-tete .horloge { height: 48px; }
  .colonnes { grid-template-columns: 1fr; overflow-y: auto; }
  .colonnes > section { min-height: auto; }
  .defile-comptoir { overflow: visible; padding-bottom: 12px; }
  .commande { flex-wrap: wrap; gap: 12px; }
  .commande .quand { width: auto; flex-direction: row; align-items: center; gap: 10px; padding: 4px 0 0 8px; }
  .commande .quand strong { font-size: 24px; line-height: 28px; }
  .commande .qui { flex-basis: 100%; padding-top: 0; }
  .commande .nom { font-size: 22px; line-height: 28px; padding-left: 8px; }
  .boisson-ligne { font-size: 17px; }
  .bouton-prete { width: 100%; min-height: 60px; font-size: 20px; }
  .panneau-ruptures { width: auto; left: 16px; }
  .toast-comptoir { white-space: normal; height: auto; min-height: 64px; width: calc(100% - 32px); }
}

/* ---------- Animations du comptoir (keyframes partagées avec styles.css) ---------- */

/* Ouverture de la page : l'en-tête, puis les cartes en vague */
.premier .comptoir-tete { animation: eveil .5s var(--courbe) backwards; }
.premier .colonne-tete { animation: fondu .5s .1s backwards; }
.premier :is(.commande, .servie, .vide-comptoir, .vide-petit) { animation: vague-entre .55s .12s var(--courbe) backwards; }
.premier .commande:nth-child(2), .premier .servie:nth-child(2) { animation-delay: .2s; }
.premier .commande:nth-child(n+3), .premier .servie:nth-child(n+3) { animation-delay: .28s; }
.premier .remises li { animation: fondu .5s .3s backwards; }

/* « Prête » ou « Remise » : la carte glisse vers la droite et s'efface, avant de changer de colonne */
@keyframes part-droite { to { opacity: 0; transform: translateX(32px) scale(.98); } }
.commande.part, .servie.part { animation: part-droite .26s ease-in forwards; pointer-events: none; }
/* Elle arrive dans « Au comptoir » par la gauche */
@keyframes entre-gauche { from { opacity: 0; transform: translateX(-24px); } }
.servie.entre { animation: entre-gauche .45s var(--courbe) backwards; }
.remises li.entre { animation: vague-entre .45s var(--courbe) backwards; }

/* La case se coche avec un petit rebond, la coche se dessine */
.boisson-ligne.vient .case { animation: pop .38s var(--courbe); }
.boisson-ligne.vient.faite .case .ico { animation: rond-plein .3s var(--courbe); }
.boisson-ligne:active { transform: scale(.99); }
.boisson-ligne { transition: background .2s, transform .16s var(--courbe); }
/* Quand tout est coché, « Prête » passe au vert en douceur */
.commande:has(.boisson-ligne.vient) .bouton-prete.pret { animation: pop .45s var(--courbe); } /* seulement au moment où la dernière case est cochée */

/* Les compteurs sautent quand ils changent */
.colonne-tete .nb.saute { animation: saute .45s var(--courbe); }

/* Ruptures : l'interrupteur glisse */
.ligne-rupture.vient .interrupteur.on::after { animation: glisse-on .26s var(--courbe); }
.ligne-rupture.vient .interrupteur:not(.on)::after { animation: glisse-off .26s var(--courbe); }
.ligne-rupture { transition: background .2s; }
.ligne-rupture:active { background: var(--sable-100); }

/* La vague de la marée ondule doucement, l'en-tête respire avec elle */
.maree-comptoir .ico { animation: ressac 3s ease-in-out infinite alternate; }

/* Appui sur les grands boutons */
.bouton-prete, .bouton-remise, .bouton-ruptures, .bouton-fermer, .toast-comptoir button { transition: transform .16s var(--courbe), background .2s; }
.bouton-remise:active, .bouton-ruptures:active, .bouton-fermer:active, .toast-comptoir button:active { transform: scale(.96); }
.retour-appli { animation: fondu .5s backwards; }
