/* Marketing : « Rejoindre INCOM » et « Partager » sur les écrans de fin, fenêtre de partage, bandeau de consentement.
   Les éléments sont créés par src/ui/marketing.js. Rien ici ne touche à l'affichage du jeu lui-même. */

/* ───────────── Écrans de fin : le bouton INCOM et le partage, sous les boutons du jeu ───────────── */
.mk { display: flex; align-items: stretch; gap: .6em; margin-top: .1em; padding-top: .85em; border-top: 1px solid rgba(255,255,255,.14); }
.mk-cta { flex: 1; min-width: 0; display: flex; align-items: center; gap: .7em; padding: .55em .8em; border-radius: .9em; background: rgba(206,243,85,.1); border: 1px solid rgba(206,243,85,.65); color: #fff; text-decoration: none; cursor: pointer; transition: background .15s, transform .12s; -webkit-tap-highlight-color: transparent; }
.mk-cta:hover { background: rgba(206,243,85,.2); transform: translateY(-.06em); }
.mk-cta img { flex: 0 0 auto; width: 2.2em; height: 2.2em; border-radius: .55em; }
.mk-cta-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1em; line-height: 1.15; }
.mk-cta-txt b { font-weight: 900; font-size: 1.05em; color: var(--lime); }
.mk-cta-txt small { font-weight: 500; font-size: .74em; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-cta i { flex: 0 0 auto; font-style: normal; font-weight: 900; font-size: 1.2em; color: var(--lime); }
.mk-share { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15em; padding: .4em .85em; border-radius: .9em; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.22); color: #fff; font: 700 .74em var(--font); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mk-share:hover { border-color: rgba(255,255,255,.5); }
.mk-share svg, .mk-grid svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mk-share svg { width: 1.8em; height: 1.8em; }

/* ───────────── Fenêtre de partage ───────────── */
#mk-share { position: fixed; inset: 0; z-index: 32; display: flex; align-items: center; justify-content: center; padding: 1em; background: rgba(8,6,16,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: clamp(12px, 1.15vw, 19px); }
.mk-sheet { position: relative; width: 27em; max-width: 96vw; max-height: 94vh; overflow: auto; padding: 1.4em 1.5em 1.1em; border-radius: 1.1em; background: rgba(18,15,30,.97); border: 1px solid rgba(206,243,85,.45); box-shadow: 0 1.5em 4em rgba(0,0,0,.6); }
.mk-sheet h3 { font-weight: 900; font-size: 1.6em; line-height: 1.05; padding-right: 1.8em; }
.mk-msg { margin: .6em 0 .9em; padding: .6em .8em; border-radius: .7em; background: rgba(255,255,255,.07); font-weight: 500; font-size: .92em; line-height: 1.4; user-select: text; -webkit-user-select: text; }
.mk-close { position: absolute; top: .7em; right: .8em; width: 2em; height: 2em; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08); color: #fff; font: 700 1.2em/1 var(--font); cursor: pointer; }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7em, 1fr)); gap: .55em; }
.mk-grid button { display: flex; flex-direction: column; align-items: center; gap: .35em; padding: .7em .3em; border-radius: .8em; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.07); color: #fff; font: 700 .86em var(--font); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mk-grid button:hover, .mk-grid button:focus-visible { border-color: var(--lime); background: rgba(206,243,85,.12); outline: none; }
.mk-grid svg { width: 1.9em; height: 1.9em; }
.mk-done { min-height: 1.3em; margin-top: .7em; font-weight: 700; font-size: .88em; color: var(--lime); }
.mk-done.mk-manual { color: #fff; font-weight: 500; word-break: break-all; user-select: text; -webkit-user-select: text; }

/* ───────────── Bandeau de consentement (jamais pendant qu'on conduit) ───────────── */
#mk-consent { position: fixed; right: 1.2em; bottom: 1.2em; z-index: 40; width: 25em; max-width: calc(100vw - 2.4em); padding: .9em 1em 1em; border-radius: 1em; background: rgba(18,15,30,.97); border: 1px solid rgba(255,255,255,.24); box-shadow: 0 1em 3em rgba(0,0,0,.55); font-size: clamp(12px, 1vw, 16px); }
body.playing #mk-consent { display: none; }
#mk-consent p { font-weight: 500; font-size: .9em; line-height: 1.4; }
#mk-consent p b { font-weight: 900; }
#mk-consent a { color: #fff; text-decoration: underline; }
/* refuser est aussi simple qu'accepter : mêmes boutons, même taille, même couleur */
.mk-consent-btns { display: flex; gap: .5em; margin-top: .75em; }
.mk-consent-btns button { flex: 1; padding: .55em .4em; border-radius: 2em; border: 1px solid rgba(255,255,255,.65); background: rgba(255,255,255,.1); color: #fff; font: 900 .9em var(--font); white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mk-consent-btns button:hover { background: rgba(255,255,255,.22); }
.mk-cookies { padding: 0; border: 0; background: none; color: #fff; opacity: .6; font: 500 .9em var(--font); letter-spacing: 0; text-transform: none; text-decoration: underline; cursor: pointer; }
.mk-cookies:hover { opacity: 1; }
.title-by .mk-cookies { margin-left: 1.2em; font-size: 1.05em; }
#screen-pause .mk-cookies { align-self: flex-start; font-size: .82em; }

/* ───────────── Téléphone tenu à l'horizontale : tout doit tenir dans une faible hauteur ───────────── */
@media (pointer: coarse) and (min-aspect-ratio: 1/1) and (max-height: 560px) {
  .mk { padding-top: .55em; gap: .45em; }
  .mk-cta { padding: .4em .65em; gap: .55em; }
  .mk-cta img { width: 1.9em; height: 1.9em; }
  #mk-share { font-size: clamp(10px, 1.45vw, 14px); }
  .mk-sheet { padding: 1em 1.2em .8em; }
  .mk-grid button { padding: .5em .3em; }
  /* le bandeau tient dans la marge à droite de la carte centrale : il ne recouvre ni « Réessayer » ni « Partager » */
  #mk-consent { right: calc(.6em + var(--sr, 0px)); bottom: calc(.6em + var(--sb, 0px)); width: 22em; max-width: 29vw; padding: .7em .8em .8em; font-size: 11px; }
  .mk-consent-btns { flex-wrap: wrap; gap: .4em; }
  .mk-consent-btns button { flex: 1 1 40%; padding: .5em .3em; }
}
/* Téléphone tenu à la verticale : le bandeau prend la largeur, en bas */
@media (max-aspect-ratio: 1/1) and (max-width: 640px) {
  #mk-consent { left: .6em; right: .6em; bottom: calc(.6em + var(--sb, 0px)); width: auto; max-width: none; font-size: 13px; }
  .mk-grid { grid-template-columns: repeat(3, 1fr); }
}
