/* RACE 2.09 — «L'ordine del tavolo» (disegno «Ordine»): stile del pannello condiviso e della barra con le facce.
   Vale solo nel menu del tavolo (public_menu.html), sopra menu2.css. tavolo.js accende la classe is-shared. */

/* scritte doppie: «Il tuo ordine» da solo, «L'ordine del tavolo» quando c'e' un altro telefono */
.m2-cart:not(.is-shared) .m2-shared, .g-cartbar:not(.is-shared) .m2-shared { display: none !important; }
.m2-cart.is-shared .m2-solo, .g-cartbar.is-shared .m2-solo { display: none !important; }

/* barra in basso: le facce di chi e' al tavolo */
.g-app.g-m2 .g-cartbar .m2-faces:not([hidden]) { display: flex; flex: none; align-items: center; }
.g-app.g-m2 .g-cartbar.is-shared { gap: 8px; padding-left: 9px; }
.g-app.g-m2 .g-cartbar.is-shared .g-count { min-width: 30px; height: 30px; font-size: 14px; }
/* con le facce la scritta non ci sta: resta per chi usa il lettore dello schermo */
.g-app.g-m2 .g-cartbar.is-shared .g-grow { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.g-app.g-m2 .g-cartbar.is-shared strong { margin-left: auto; }
.m2-face { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(255,255,255,.75); font-size: 12px; font-weight: 800; letter-spacing: -.02em; }
.m2-faces .m2-face + .m2-face { margin-left: -10px; }
.m2-face.c0 { background: #F9D9E4; color: #8A1C44; }
.m2-face.c1 { background: #E9DDCF; color: #1D1D1F; }
.m2-face.c2 { background: #D8E7FF; color: #1B3F7A; }
.m2-face.c3 { background: #FDE7C8; color: #8A5300; }

/* pannello: la mia scheda con il bordo, poi gli altri */
.g-app .m2-cart.is-shared .m2-mycard { padding: 14px; border-radius: 24px; background: var(--m2-card-soft); border: 1.5px solid var(--g-accent); }
.g-app .m2-cart.is-shared .m2-mycard .m2-lines { margin-top: 4px; padding: 0; border-radius: 0; background: transparent; }
.g-app .m2-cart.is-shared .m2-mycard .m2-line:last-child { padding-bottom: 2px; }
.g-app .m2-cart.is-shared .m2-mycard .g-hint { display: none; }
.m2-person-head { display: flex; align-items: center; gap: 12px; }
.m2-person-head .m2-face { border: 0; font-size: 15px; }
.m2-person-name { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.m2-person-name b { display: flex; align-items: center; gap: 7px; overflow: hidden; font-size: 17px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.m2-person-name small { display: inline-flex; align-items: center; gap: 4px; color: var(--g-muted); font-size: 13px; line-height: 1.35; }
.m2-you { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--g-accent); color: var(--g-on-accent); font-size: 11px; font-style: normal; font-weight: 800; }
.m2-person-total { flex: none; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.m2-others { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.m2-others:empty { display: none; }
.m2-person { padding: 14px; border-radius: 24px; background: var(--m2-card-soft); animation: m2-appare .35s ease both; }
.m2-person-line { display: flex; align-items: center; gap: 12px; padding-top: 10px; }
.m2-person-line img, .m2-person-line > i { flex: none; width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
.m2-person-line > i { display: grid; place-items: center; background: color-mix(in srgb, var(--g-accent) 22%, var(--g-surface)); color: var(--g-ink);
  font-style: normal; font-weight: 800; opacity: .75; }
.m2-person-line span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.m2-person-line b { overflow: hidden; font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.m2-person-line small { overflow: hidden; color: var(--g-muted); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.m2-person-line em { flex: none; color: var(--g-muted); font-size: 14px; font-style: normal; font-variant-numeric: tabular-nums; }
.m2-dots { display: inline-flex; gap: 3px; margin-left: 2px; }
.m2-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: m2-punto 1.2s ease-in-out infinite; }
.m2-dots i:nth-child(2) { animation-delay: .15s; }
.m2-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes m2-punto { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

/* «Invita qualcuno al tavolo»: riga tratteggiata */
.g-app .m2-invite { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 12px 14px; border: 1.5px dashed color-mix(in srgb, var(--g-ink) 22%, transparent);
  border-radius: 22px; background: transparent; color: var(--g-ink); font: inherit; text-align: left; cursor: pointer; }
.m2-invite-ico { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--m2-chip); }
.m2-invite-text { display: flex; flex-direction: column; min-width: 0; }
.m2-invite-text b { font-size: 15px; font-weight: 700; }
.m2-invite-text small { color: var(--g-muted); font-size: 13px; }

/* in fondo: conferma se qualcuno sceglie ancora, poi «Inviato in cucina!» */
.g-app .m2-confirm:not([hidden]) { display: block; margin: 0 0 12px; padding: 14px; border-radius: 20px; background: color-mix(in srgb, #FF9500 16%, var(--g-surface)); animation: m2-appare .3s ease both; }
.m2-confirm p { margin: 0 0 10px; font-size: 15px; font-weight: 700; line-height: 1.4; }
.m2-confirm div { display: flex; gap: 10px; }
.g-app .m2-confirm .g-btn { flex: 1; height: 48px; margin: 0; border-radius: 999px; font-size: 15px; box-shadow: none; }
.g-app .m2-confirm .g-btn.ghost { background: var(--m2-chip); color: var(--g-ink); }
.g-app .m2-sent:not([hidden]) { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 14px; border-radius: 22px; background: rgba(52,199,89,.16); animation: m2-appare .35s ease both; }
.m2-sent-tick { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: #34C759; color: #FFFFFF; animation: m2-spunta .4s cubic-bezier(.3, 1.6, .5, 1) .1s both; }
.m2-sent-text { display: flex; flex-direction: column; min-width: 0; }
.m2-sent-text b { font-size: 16px; font-weight: 800; }
.m2-sent-text small { color: var(--g-muted); font-size: 13px; line-height: 1.4; }
.m2-sent-text a { margin-top: 4px; color: var(--g-ink); font-size: 14px; font-weight: 800; }

@media (prefers-reduced-motion: reduce) { .m2-dots i, .m2-person, .m2-confirm, .m2-sent, .m2-sent-tick { animation: none; } }
