/* =========================================================================
   Mini-jeux du MANDAT : La poignée de main · La fuite · L'agenda
   (js/mandate-games.js). Reprend l'habillage des autres mini-jeux :
   overlay plein écran, bandeau .mgm-top, boîte de fin .mgu-end.
   ========================================================================= */
.mg-mand {
  position: absolute; inset: 0; z-index: 4000; display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 10px) 0 calc(env(safe-area-inset-bottom) + 8px);
  background: #191c31; color: #f3eef6; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.mg-mand .mgm-brand { color: #ffd54f; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* petits téléphones (≤ 370 px) : le bandeau tient sur une ligne sans déborder */
@media (max-width: 370px) {
  .mg-mand .mgm-top { gap: 7px; padding-left: 10px; padding-right: 10px; }
  .mg-mand .mgm-brand { font-size: 16px; }
  .mg-mand .mgm-round { font-size: 12px; }
  .mg-mand .mgm-score { font-size: 14px; padding: 5px 8px; }
}
.mgx-stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.mgx-scroll .mgx-stage { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px 18px; gap: 12px; }
.mg-mand .mgu-end { max-height: calc(100% - 40px); overflow-y: auto; }

/* ---------- La poignée de main ---------- */
.mg-poignee { touch-action: none; -webkit-touch-callout: none; }
/* aucun texte sélectionnable pendant qu'on maintient l'écran (sinon menu natif Copier / Traduire) */
.mg-poignee, .mg-poignee * { -webkit-user-select: none !important; user-select: none !important; -webkit-touch-callout: none !important; -webkit-tap-highlight-color: transparent; }
.mg-poignee img { -webkit-user-drag: none; pointer-events: none; }
.mg-poignee .mgx-stage { padding: 10px 14px 0; gap: 10px; }
.mgh-perron { position: relative; flex: 1 1 auto; min-height: 0; border-radius: 20px; overflow: hidden;
  background: linear-gradient(180deg, #232c5c 0%, #171d42 60%, #3a1622 60%, #2a1019 100%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.mgh-cols { position: absolute; inset: 0 0 40% 0;
  background: linear-gradient(90deg, transparent 5%, rgba(255,255,255,.06) 5% 10%, transparent 10% 90%, rgba(255,255,255,.06) 90% 95%, transparent 95%); }
.mgh-carpet { position: absolute; left: 50%; bottom: 0; width: 48%; height: 40%; transform: translateX(-50%) perspective(260px) rotateX(36deg); transform-origin: 50% 100%;
  background: repeating-linear-gradient(180deg, #b3122e 0 18px, #9b0f27 18px 20px); }
.mgh-who { position: absolute; left: 0; right: 0; top: 14px; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.mgh-who img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: #20284c; box-shadow: 0 0 0 3px #fff, 0 10px 24px rgba(0,0,0,.5); }
.mgh-nm { font-weight: 900; font-size: 18px; }
.mgh-rl { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; color: #b9a9c4; }
.mgh-bubble { position: absolute; left: 50%; top: 150px; transform: translateX(-50%); max-width: 86%; padding: 8px 13px; border-radius: 14px; background: #fff; color: #191c31;
  font-weight: 800; font-size: 14px; text-align: center; opacity: 0; transition: opacity .2s; pointer-events: none; }
.mgh-bubble.show { opacity: 1; }
.mgh-hand { position: absolute; left: 50%; bottom: 7%; width: 240px; height: 220px; margin-left: -120px; display: grid; place-items: center;
  font-size: 190px; line-height: 1; filter: drop-shadow(0 16px 22px rgba(0,0,0,.55)); pointer-events: none; }
@media (max-height: 700px) { .mgh-hand { font-size: 150px; height: 180px; } .mgh-bubble { top: 140px; } }
.mgh-big { position: absolute; left: 0; right: 0; top: 42%; text-align: center; font-weight: 900; font-size: 46px; color: #fff; text-shadow: 0 4px 0 rgba(0,0,0,.45); pointer-events: none; opacity: 0; }
.mgh-big.go { color: #ffd54f; }
.mgh-big.rel { color: #ff6b81; }
.mgh-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.mgh-verdict { position: absolute; left: 10px; right: 10px; bottom: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(18,20,40,.94); box-shadow: 0 0 0 1px rgba(255,255,255,.14); }
.mgh-verdict[hidden] { display: none; }
.mgh-verdict b { float: right; font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.mgh-verdict .t { font-weight: 900; font-size: 16px; }
.mgh-verdict .d { margin-top: 3px; font-size: 13px; color: #cfd5ee; line-height: 1.35; }
.mgh-verdict .pos { color: #4ade80; } .mgh-verdict .neg { color: #ff6b81; }
.mgh-gauge { display: flex; flex-direction: column; gap: 6px; }
.mgh-track { position: relative; height: 30px; border-radius: 15px; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); overflow: hidden; }
.mgh-zone { position: absolute; top: 0; bottom: 0; border-radius: 15px; background: rgba(74,222,128,.28); box-shadow: inset 0 0 0 2px #4ade80; }
.mgh-me { position: absolute; top: -3px; bottom: -3px; width: 8px; margin-left: -4px; border-radius: 4px; background: #fff; box-shadow: 0 0 0 2px #191c31, 0 0 12px rgba(255,255,255,.6); }
.mgh-ends { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #8b93b8; }
.mgh-status { min-height: 20px; text-align: center; font-weight: 900; font-size: 15px; }
.mgh-status.ok { color: #4ade80; } .mgh-status.lo { color: #6aa8ff; } .mgh-status.hi { color: #ff6b81; }
.mgh-press { margin: 0 14px 4px; height: 64px; border-radius: 18px; display: flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 900; font-size: 16px; color: #b9a9c4; background: rgba(255,255,255,.06); border: 2px dashed rgba(255,255,255,.18); transition: background .1s, color .1s; }
.mg-poignee.live .mgh-press { color: #fff; border-color: rgba(255,107,129,.7); }
.mg-poignee.pressing .mgh-press { background: rgba(255,107,129,.28); border-style: solid; }
.mgh-press-ico { font-size: 22px; animation: mghTap 1.1s ease-in-out infinite; }
.mg-poignee.pressing .mgh-press-ico { animation: none; transform: scale(.85); }
@keyframes mghTap { 50% { transform: translateY(4px) scale(.9); } }
.mg-poignee.over .mgh-press { visibility: hidden; }
.mgh-une { display: block; margin-bottom: 6px; font-family: Georgia, 'Times New Roman', serif; font-size: 15px; color: #fff; line-height: 1.3; }

/* ---------- La fuite ---------- */
.mgf-une { background: #f3efe4; color: #15151a; border-radius: 6px; padding: 12px 14px 14px; box-shadow: 0 12px 28px rgba(0,0,0,.45); transform: rotate(-1deg); flex: 0 0 auto; }
.mgf-mast { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 3px double #15151a; padding-bottom: 5px; font: 800 18px/1 Georgia, 'Times New Roman', serif; }
.mgf-mast small { font: 600 11px/1 Inter, system-ui, sans-serif; color: #555; }
.mgf-exc { display: inline-block; margin-top: 9px; padding: 3px 7px; background: #c8102e; color: #fff; font-weight: 900; font-size: 10.5px; letter-spacing: .08em; }
.mgf-hl { margin-top: 6px; font: 800 21px/1.15 Georgia, 'Times New Roman', serif; }
.mgf-lead { margin-top: 6px; font-size: 13px; line-height: 1.45; color: #333; }
.mgf-brief { font-size: 14px; line-height: 1.5; color: #cfd5ee; }
.mgf-brief b { color: #fff; }
.mgf-sec { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
.mgf-sec b { font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: #ffd54f; }
.mgf-sec span { font-size: 12.5px; color: #8b93b8; }
.mgf-sus { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mgf-s { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 11px; border-radius: 16px; border: 2px solid transparent;
  background: rgba(255,255,255,.07); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.mgf-av { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 4px; font-weight: 900; font-size: 14px; color: #fff; }
.mgf-n { font-weight: 900; font-size: 14px; line-height: 1.2; }
.mgf-r { font-size: 12px; color: #b9a9c4; line-height: 1.3; }
.mgf-m { font-size: 11.5px; color: #8b93b8; line-height: 1.3; margin-top: 2px; }
.mgf-s.out { opacity: .42; }
.mgf-s.out .mgf-n { text-decoration: line-through; text-decoration-thickness: 2px; }
.mgf-s.out::after { content: "INNOCENTÉ"; position: absolute; right: 9px; top: 11px; font-size: 9px; font-weight: 900; letter-spacing: .08em; color: #4ade80; }
.mgf-s.pick { border-color: #ff6b81; background: rgba(255,107,129,.16); }
.mgf-clues { display: flex; flex-direction: column; gap: 9px; }
.mgf-c { display: flex; gap: 12px; align-items: flex-start; padding: 11px 13px; border-radius: 14px; border: 0; background: #d9b26a; color: #2a1e08;
  box-shadow: inset 0 -4px 0 #9c7a3c; font: inherit; text-align: left; cursor: pointer; }
.mgf-c.open { background: #f3efe4; color: #15151a; box-shadow: none; cursor: default; }
.mgf-c.locked { opacity: .4; cursor: default; }
.mgf-ic { font-size: 20px; line-height: 1.2; }
.mgf-ct { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mgf-ct b { font-weight: 900; font-size: 14px; }
.mgf-sub { font-size: 12.5px; opacity: .75; }
.mgf-body { margin-top: 3px; font: 500 13px/1.5 'JetBrains Mono', ui-monospace, monospace; color: #222; }
.mgf-bar { position: sticky; bottom: -18px; display: flex; gap: 10px; padding: 12px 0 6px; margin-top: 2px; background: linear-gradient(180deg, rgba(25,28,49,0), #191c31 35%); }
.mgf-btn { flex: 1; height: 50px; border: 0; border-radius: 999px; font: inherit; font-weight: 900; font-size: 15px; cursor: pointer; color: #fff; }
.mgf-btn.red { background: #e5484d; box-shadow: 0 4px 0 #9e2a2e; }
.mgf-btn.sec { background: rgba(255,255,255,.12); box-shadow: 0 4px 0 rgba(0,0,0,.35); }
.mgf-btn:disabled { opacity: .5; cursor: default; }
.mgf-btn:active:not(:disabled) { transform: translateY(2px); }
.mgf-stamp { display: inline-block; margin-bottom: 8px; padding: 5px 10px; border: 3px solid currentColor; border-radius: 8px; font-weight: 900; letter-spacing: .1em; transform: rotate(-3deg); }
.mgf-stamp.ok { color: #4ade80; } .mgf-stamp.ko { color: #ff6b81; }

/* ---------- L'agenda ---------- */
.mg-agenda { --mga-row: 40px; }
.mga-hot { color: #ff6b6b; }
.mga-help { font-size: 13.5px; line-height: 1.45; color: #cfd5ee; }
.mga-help b { color: #fff; }
.mga-board { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 10px; align-items: start; }
.mga-cal { display: grid; grid-template-columns: 32px 1fr; border-radius: 14px; background: rgba(255,255,255,.06); padding: 6px 6px 6px 0; }
.mga-hours { display: flex; flex-direction: column; }
.mga-hours span { height: var(--mga-row); font-size: 10.5px; font-weight: 700; color: #8b93b8; text-align: right; padding-right: 6px; transform: translateY(-5px); font-variant-numeric: tabular-nums; }
.mga-grid { position: relative; height: calc(var(--mga-row) * 12); }
.mga-slot { position: absolute; left: 0; right: 0; height: var(--mga-row); border-top: 1px dashed rgba(255,255,255,.14); }
.mga-slot.ok { background: rgba(74,222,128,.14); box-shadow: inset 3px 0 0 #4ade80; cursor: pointer; }
.mga-ev { position: absolute; left: 3px; right: 3px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; padding: 5px 8px; border: 0; border-radius: 10px;
  color: #10142c; font: inherit; text-align: left; cursor: pointer; }
.mga-ev .t { font-weight: 900; font-size: 12px; line-height: 1.15; }
.mga-ev .m { font-size: 10.5px; font-weight: 700; opacity: .75; }
.mga-ev.urgent { box-shadow: 0 0 0 2px #fff; color: #fff; }
.mga-tray { display: flex; flex-direction: column; gap: 8px; }
.mga-tray-h { font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: #ffd54f; }
.mga-tray-h span { float: right; letter-spacing: .02em; color: #b9a9c4; font-variant-numeric: tabular-nums; }
.mga-blk { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border-radius: 12px; border: 2px solid transparent; background: rgba(255,255,255,.08);
  color: inherit; font: inherit; text-align: left; cursor: pointer; }
.mga-blk .t { font-weight: 900; font-size: 12.5px; line-height: 1.2; }
.mga-blk .m { font-size: 10.5px; font-weight: 700; color: #b9a9c4; }
.mga-blk .p { font-size: 11px; font-weight: 900; color: #4ade80; }
.mga-blk.sel { border-color: #ffd54f; background: rgba(255,213,79,.14); }
.mga-blk.must .t::after { content: " · obligatoire"; color: #ff8a80; font-size: 11px; }
.mga-blk.urgent { border-color: #ff6b81; animation: mgaPulse 1s ease-in-out infinite; }
@keyframes mgaPulse { 50% { box-shadow: 0 0 0 4px rgba(255,107,129,.25); } }
.mga-empty { font-size: 12.5px; color: #8b93b8; padding: 6px 2px; }
.mga-done { align-self: stretch; margin-top: 4px; }
.mga-alert { position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; padding: 20px 16px; background: rgba(8,10,24,.78); }
.mga-alert-card { width: 100%; max-width: 380px; padding: 20px 18px; border-radius: 18px; text-align: center; background: rgba(18,20,40,.97); box-shadow: 0 0 0 2px #ff6b81, 0 16px 40px rgba(0,0,0,.5); animation: mguPopIn .35s cubic-bezier(.3,1.5,.5,1); }
.mga-alert-k { font-weight: 900; font-size: 20px; color: #ff6b81; }
.mga-alert-t { margin-top: 6px; font-weight: 900; font-size: 19px; }
.mga-alert-card p { margin-top: 8px; font-size: 14px; color: #cfd5ee; line-height: 1.45; }
.mga-alert-card p b { color: #fff; }

/* ---------- Cases de la frise ---------- */
.tl-bubble[data-type="poignee"] { --type-color: #ff9f43; --type-glow: rgba(255,159,67,.45); }
.tl-bubble[data-type="fuite"]   { --type-color: #b07bff; --type-glow: rgba(176,123,255,.45); }
.tl-bubble[data-type="agenda"]  { --type-color: #3aa0e0; --type-glow: rgba(58,160,224,.45); }

@media (prefers-reduced-motion: reduce) {
  .mgh-press-ico, .mga-blk.urgent { animation: none !important; }
}
