/* Où se cache l'équipe Ivasic ? · charte Entreprise Ivasic · pensé pour le pouce d'abord */

@font-face { font-family: 'Righteous'; src: url('polices/Righteous-Regular.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Akzidenz'; src: url('polices/AkzidenzGroteskBQ-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Akzidenz'; src: url('polices/AkzidenzGroteskBQ-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --nuit: #023F86;
  --clair: #0071B9;
  --cyan: #2EB0CF;
  --orange: #D77431;
  --encre: #33475E;
  --neige: #F2F7FB;
  --blanc: #FFFFFF;
  --ombre: 0 18px 44px rgba(2, 36, 70, .28);
  --barre-h: 56px;
  --plan-h: 46px;
}

* { box-sizing: border-box; }

/* .voile, .barre et #scene posent un display : sans ce !important, l'attribut hidden ne
   masquerait plus rien et toutes les modales s'empileraient à l'écran. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--nuit);
  font-family: 'Akzidenz', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 500;
  color: var(--encre);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

h1, h2 { font-family: 'Righteous', 'Helvetica Neue', Arial, sans-serif; font-weight: 400; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 8.4vw, 42px); line-height: 1.08; color: var(--nuit); }
h1 em { font-style: normal; color: var(--clair); }
h2 { font-size: clamp(24px, 6.6vw, 32px); color: var(--nuit); }

.surtitre {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--orange);
}

/* ------------------------------------------------------------------ voiles et cartes */
.voile {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: rgba(2, 36, 70, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: voile-entre .22s ease-out;
}
@keyframes voile-entre { from { opacity: 0; } }

.carte {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: auto 0 0;
  padding: 26px 22px 22px;
  background: var(--blanc);
  border-radius: 26px;
  box-shadow: var(--ombre);
  animation: carte-monte .26s cubic-bezier(.2, .9, .3, 1);
}
.carte-etroite { max-width: 400px; }
@keyframes carte-monte { from { transform: translateY(26px); opacity: 0; } }

@media (min-height: 620px) {
  .voile { align-items: center; }
  .carte { margin: auto; }
}

.fermer {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--neige);
  color: var(--nuit);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

/* ------------------------------------------------------------------ boutons */
.bouton {
  display: block;
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  padding: 14px 20px;
  border: 2px solid var(--nuit);
  border-radius: 26px;
  background: var(--blanc);
  color: var(--nuit);
  font: inherit;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  transition: transform .1s;
}
.bouton:active { transform: scale(.98); }
.bouton-primaire { background: var(--clair); border-color: var(--clair); color: var(--blanc); }
.bouton-primaire:disabled { opacity: .6; cursor: default; }

.lien-discret {
  display: block;
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: #7E93A8;
  text-decoration: underline;
}

/* ------------------------------------------------------------------ accueil */
.accueil-carte { text-align: left; }
.accueil-logo { width: 116px; height: auto; margin-bottom: 14px; }
.accueil-texte { margin: 14px 0 0; font-size: 15.5px; line-height: 1.5; }
.accueil-regles { margin: 16px 0 4px; padding: 0; list-style: none; }
.accueil-regles li {
  position: relative;
  margin-bottom: 8px;
  padding-left: 26px;
  font-size: 14.5px;
  line-height: 1.45;
}
.accueil-regles li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan);
}
.accueil-reprise { margin: 10px 0 0; text-align: center; font-size: 13.5px; color: var(--clair); font-weight: 700; }

/* ------------------------------------------------------------------ barre du haut */
.barre {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  height: calc(var(--barre-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0;
  background: linear-gradient(180deg, rgba(2, 36, 70, .92) 0%, rgba(2, 36, 70, .72) 70%, rgba(2, 36, 70, 0) 100%);
  pointer-events: none;
}
.barre > * { pointer-events: auto; }
.barre-logo { height: 26px; width: auto; }

.compteur {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 8px 14px;
  border: 0;
  border-radius: 20px;
  background: var(--blanc);
  color: var(--nuit);
  font: inherit;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
}
.compteur svg { width: 10px; height: 6px; opacity: .55; }
.compteur-total { color: #90A6BC; font-size: 14px; }
.compteur.bondit { animation: bondit .5s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes bondit { 40% { transform: scale(1.22); } }

.bouton-indice {
  padding: 8px 14px;
  border: 0;
  border-radius: 20px;
  background: var(--orange);
  color: var(--blanc);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

/* ------------------------------------------------------------------ scène */
#scene { position: fixed; inset: 0; }
#toile { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#toile.tire { cursor: grabbing; }

.plan {
  position: absolute;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 15;
  width: min(92vw, 560px);
  height: var(--plan-h);
  transform: translateX(-50%);
  border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(2, 36, 70, .35);
}
.plan img { display: block; width: 100%; height: 100%; object-fit: cover; }
.plan-cadre {
  position: absolute;
  top: 0;
  height: 100%;
  border: 2px solid var(--orange);
  border-radius: 4px;
  background: rgba(215, 116, 49, .16);
  pointer-events: none;
}
.plan-points { position: absolute; inset: 0; pointer-events: none; }
.plan-points i {
  position: absolute;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 1.5px #fff;
}

.souffle {
  position: absolute;
  left: 50%;
  top: calc(var(--barre-h) + env(safe-area-inset-top) + 10px);
  z-index: 18;
  margin: 0;
  padding: 9px 16px;
  transform: translateX(-50%);
  border-radius: 20px;
  background: rgba(2, 36, 70, .9);
  color: var(--blanc);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  animation: souffle-entre .2s ease-out;
}
@keyframes souffle-entre { from { opacity: 0; transform: translate(-50%, -8px); } }

/* ------------------------------------------------------------------ modale « qui ? » */
.choix {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.choix button {
  min-height: 46px;
  padding: 10px 8px;
  border: 2px solid #DCE7F0;
  border-radius: 14px;
  background: var(--blanc);
  color: var(--nuit);
  font: inherit;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
}
.choix button:active { background: var(--neige); }
.choix button[disabled] {
  border-color: #EDF2F7;
  background: #F7FAFC;
  color: #AFC0D0;
  text-decoration: line-through;
  cursor: default;
}
.choix button.rate { animation: rate .4s; border-color: #D64B4B; color: #D64B4B; }
@keyframes rate {
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}

.erreur { margin: 12px 0 0; color: #C03A3A; font-size: 14px; font-weight: 700; text-align: center; }

/* ------------------------------------------------------------------ liste à trouver */
.liste-items { margin: 14px 0 0; padding: 0; list-style: none; }
.liste-items li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #EDF2F7;
  font-size: 15.5px;
}
.liste-items li:last-child { border-bottom: 0; }
.liste-items .pastille {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #E7EEF5;
  color: #FFF;
  font-size: 13px;
}
.liste-items .trouve .pastille { background: var(--cyan); }
.liste-items .trouve span { color: #8FA4B8; text-decoration: line-through; }
.liste-items .bonus-sep {
  padding-top: 14px;
  border: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--orange);
}

/* ------------------------------------------------------------------ fin */
.fin-carte { max-width: 520px; }
.fin-temps { margin: 6px 0 0; font-size: 15px; color: var(--clair); font-weight: 700; }
/* sept médaillons sur une ligne tiennent sur un ordinateur, pas sur un téléphone :
   en dessous de 520 px on les range sur deux rangs */
.equipe {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 8px;
  margin: 18px 0 4px;
}
@media (min-width: 520px) { .equipe { grid-template-columns: repeat(7, 1fr); gap: 6px; } }
.equipe figure { margin: 0; text-align: center; }
.equipe img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  object-fit: cover;
  animation: pop .4s backwards;
}
.equipe figcaption { margin-top: 5px; font-size: 11.5px; font-weight: 700; color: var(--nuit); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.fin-texte { margin: 14px 0 0; font-size: 15px; line-height: 1.5; }

#formulaire { margin-top: 18px; }
#formulaire label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 700; color: var(--nuit); }
#formulaire input:not([type=checkbox]) {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 13px 14px;
  border: 2px solid #DCE7F0;
  border-radius: 14px;
  background: var(--blanc);
  font: inherit;
  font-size: 16px;
  color: var(--encre);
}
#formulaire input:focus { outline: 0; border-color: var(--clair); }
.champs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.case { display: flex !important; gap: 10px; align-items: flex-start; margin-top: 4px; }
.case input { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px; accent-color: var(--clair); }
.case span { font-weight: 500; font-size: 12.5px; line-height: 1.45; color: var(--encre); }
.case a { color: var(--clair); }

.merci-titre { margin: 8px 0 0; font-family: 'Righteous', Arial, sans-serif; font-size: 22px; color: var(--clair); }
.merci-texte { margin: 6px 0 0; font-size: 15px; line-height: 1.5; }

/* ------------------------------------------------------------------ indice */
.indice-texte { margin: 10px 0 0; font-size: 16px; line-height: 1.5; }

/* ------------------------------------------------------------------ règlement */
.page {
  height: 100%;
  overflow-y: auto;
  background: var(--neige);
  padding: 24px 18px 60px;
}
.page-contenu { max-width: 680px; margin: 0 auto; }
.page h1 { margin-bottom: 4px; }
.page h3 { margin: 26px 0 6px; font-size: 16px; color: var(--nuit); }
.page p, .page li { font-size: 15px; line-height: 1.6; }
.page ul { padding-left: 20px; }
.page .retour { display: inline-block; margin-bottom: 18px; color: var(--clair); font-weight: 700; text-decoration: none; }

/* passages que Christophe doit valider avant la mise en ligne : visibles, impossibles à oublier */
[data-a-remplir] { background: #FFF2C9; box-shadow: 0 0 0 3px #FFF2C9; border-radius: 2px; }

/* invitation à passer en paysage : un panorama de 5,6:1 y gagne énormément */
.tourne {
  position: absolute;
  left: 50%;
  bottom: calc(var(--plan-h) + max(18px, env(safe-area-inset-bottom)) + 10px);
  z-index: 16;
  margin: 0;
  padding: 9px 16px;
  transform: translateX(-50%);
  border-radius: 20px;
  background: rgba(255, 255, 255, .94);
  color: var(--nuit);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(2, 36, 70, .25);
}
@media (orientation: landscape), (min-width: 700px) { .tourne { display: none !important; } }

.plan { touch-action: none; cursor: pointer; }

/* ------------------------------------------------------------------ menu de partage */
.partage-choix { margin-top: 16px; }
.canal {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 56px;
  margin-bottom: 8px;
  padding: 9px 14px 9px 9px;
  border: 2px solid #DCE7F0;
  border-radius: 16px;
  background: var(--blanc);
  color: var(--nuit);
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  transition: transform .1s, border-color .15s;
}
.canal:last-child { margin-bottom: 0; }
.canal:active { transform: scale(.985); }
.canal:hover { border-color: var(--clair); }
.canal-icone {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #FFF;
}
.canal-icone svg { width: 21px; height: 21px; }

.partage-lien {
  display: none;
  margin: 14px 0 0;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--neige);
  color: var(--nuit);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
}
/* repli quand le presse-papier est refusé (Safari hors geste direct, http) : on montre
   l'adresse, le joueur la copie lui-même */
.partage-lien.montre { display: block; }
.canal.copie { border-color: var(--cyan); color: var(--cyan); }
.canal.copie .canal-icone { background: var(--cyan) !important; }
