:root{
  --bg:#ffffff;
  --line:rgba(0,0,0,.10);
  --txt:rgba(0,0,0,.88);
  --muted:rgba(0,0,0,.55);
  --bad:#dc2626;

  --shadow: 0 10px 28px rgba(0,0,0,.10);
  --r:18px;

  --orange1:#fb923c;
  --orange2:#f97316;
}

*{ box-sizing:border-box; -webkit-tap-highlight-color: transparent; }
html, body{ height:100%; }

body{
  margin:0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, Segoe UI, Roboto, Arial;
  color:var(--txt);
  background:
  radial-gradient(900px 520px at 20% 0%, rgba(102,178,255,.16), transparent 60%),
  radial-gradient(900px 520px at 85% 10%, rgba(180,220,255,.14), transparent 60%),
  radial-gradient(900px 520px at 50% 85%, rgba(249,115,22,.10), transparent 60%), /* touche warm */
  linear-gradient(180deg, #fffaf5 0%, #f3f9ff 55%, #fffaf5 100%);



  padding: calc(16px + env(safe-area-inset-top)) 14px calc(22px + env(safe-area-inset-bottom));
}

/* Top */
.topbar{
  max-width:1100px;
  margin:0 auto 14px;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  flex-direction:column;
  gap:6px;
}

.page-title{
  width:100%;
  text-align:center;
  margin:0;
  font-family: "Fraunces", "Poppins", system-ui, Arial;
  font-weight: 800;
  font-size: clamp(34px, 7.5vw, 58px);
  letter-spacing: .2px;
  color: rgba(20,20,20,.92);
}



.progress{
  width:100%;
  text-align:center;
  font-weight:300;
  color:var(--muted);
  font-size:13px;
}

/* Grid smaller tiles */
.wrap{ max-width:900px; margin:0 auto; }

.grid{
  display:grid;
  gap:8px;
  grid-template-columns: repeat(10, minmax(0, 1fr));
}
@media (max-width: 1000px){ .grid{grid-template-columns:repeat(8,1fr);} }
@media (max-width: 720px){  .grid{grid-template-columns:repeat(6,1fr);} }
@media (max-width: 420px){  .grid{grid-template-columns:repeat(4,1fr);} }

.door{
  position:relative;
  width:100%;
  aspect-ratio: 1 / 1;

  border-radius: 9999px;   /* ROND */
  overflow:hidden;
  padding:0;
  touch-action: manipulation;

  /* fond derrière la "porte" (visible quand ouvert) */
  background: radial-gradient(circle at 35% 30%,
    rgba(255,255,255,.95),
    rgba(255,255,255,.80) 40%,
    rgba(0,0,0,.03) 100%);

  border: 1px solid rgba(0,0,0,.10);
  box-shadow:
    0 12px 28px rgba(0,0,0,.12),
    inset 0 1px 0 rgba(255,255,255,.70);

  transform: translateZ(0);

  /* 1–30 Guatemala (bleu/blanc/bleu vertical) */
.door.gt{
  --flag: linear-gradient(90deg,
    #66B2FF 0 33.33%,
    #ffffff 33.33% 66.66%,
    #66B2FF 66.66% 100%);
}

/* 31–48 France (bleu/blanc/rouge vertical) */
.door.fr{
  --flag: linear-gradient(90deg,
    #0055A4 0 33.33%,
    #ffffff 33.33% 66.66%,
    #EF4135 66.66% 100%);
}

}


/* Number on front */
.front-number{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;

  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, Arial;
  font-weight: 800; /* bold */
  font-size: clamp(22px, 5.2vw, 46px);
  letter-spacing: .5px;

  color: rgba(255,255,255,.98);
  z-index:4;
  pointer-events:none;

  /* lisibilité ++ */
  text-shadow:
    0 10px 22px rgba(0,0,0,.32),
    0 2px 0 rgba(0,0,0,.10);

  /* petit contour soft (super lisible) */
  -webkit-text-stroke: 1px rgba(0,0,0,.10);
}

.door.open .front-number{ opacity:0; }

/* Door face */
.door::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: 9999px;

  /* la face = le drapeau */
  background: var(--flag, linear-gradient(180deg, #fb923c, #f97316));

  /* glossy / relief */
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.55),
    inset 0 -10px 24px rgba(0,0,0,.12);

  transform-origin:left center;
  transform: translateZ(0);
  transition: transform .38s cubic-bezier(.2,.9,.2,1);
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  z-index:2;
}


/* knob */
.door::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius: 9999px;
  z-index:3;
  pointer-events:none;

  /* reflet glossy */
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.65), rgba(255,255,255,0) 55%),
    linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0) 45%);

  mix-blend-mode: screen;
  opacity: .95;
  transition: opacity .2s ease;
}


.door.open::before{ transform: perspective(900px) rotateY(-110deg); }
.door.open::after{ opacity:.25; }

/* Smooth “app-like” press */
.door:active{
  transform: scale(0.985);
}

/* Opening burst animation */
@keyframes pop {
  0%   { transform: scale(1); }
  55%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}
@keyframes swingDoor {
  0%   { transform: perspective(900px) rotateY(0deg) translateZ(0); }
  70%  { transform: perspective(900px) rotateY(-125deg) translateZ(0); }
  100% { transform: perspective(900px) rotateY(-110deg) translateZ(0); }
}
@keyframes fadeFront {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-2px); }
}
.door.opening{ animation: pop .35s ease-out; }
.door.open.opening::before{ animation: swingDoor .55s cubic-bezier(.2,.9,.2,1) both; }
.door.open.opening .front-number{ animation: fadeFront .20s ease-out both; }

@media (prefers-reduced-motion: reduce){
  .door, .door::before, .door.opening, .door.open.opening::before, .door.open.opening .front-number{
    animation:none !important;
    transition:none !important;
  }
}

/* Confetti canvas */
.fx{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index: 500;
}

/* Modal */
.overlay{
  position:fixed;
  inset:0;
  display:none;
  align-items:flex-end;
  justify-content:center;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  background: rgba(0,0,0,.35);
  z-index:999;
}
.overlay.show{display:flex;}

.sheet{
  width:min(560px, 100%);
  border-radius: 18px;
  background: #ffffff;
  border:1px solid var(--line);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.sheet-head{
  margin:0;
  padding:14px 14px 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border-bottom:1px solid rgba(0,0,0,.08);
}

.sheet h2{
  margin:0;
  font-size:16px;
  font-weight:400;
}

.sheet-body{
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

label{ font-size:13px; color:var(--muted); font-weight:300; }

input{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.14);
  background:rgba(0,0,0,.03);
  color:var(--txt);
  font:inherit;
  outline:none;
  font-weight:300;
}
input:focus{
  border-color: rgba(249,115,22,.55);
  box-shadow: 0 0 0 4px rgba(249,115,22,.14);
}

.row{ display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; }

.btn, .close, .primary{
  appearance:none;
  border:none;
  border-radius:12px;
  padding:12px 14px;
  touch-action: manipulation;
  font-weight:300;
}
.btn{
  background:rgba(0,0,0,.04);
  color:var(--txt);
  border:1px solid var(--line);
  box-shadow: 0 8px 18px rgba(0,0,0,.08);
}
.close{
  border:1px solid rgba(0,0,0,.14);
  background:transparent;
  color: var(--txt);
  padding:10px 12px;
}
.primary{
  background: rgba(249,115,22,.18);
  border:1px solid rgba(249,115,22,.35);
  color: var(--txt);
}
.btn:active, .close:active, .primary:active{ transform: translateY(1px); }

.err{ font-size:13px; color:var(--bad); display:none; font-weight:300; }
.err.show{ display:block; }

.reveal{
  margin-top:4px;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,.10);
  background: rgba(0,0,0,.03);
  display:none;
}
.reveal.show{ display:block; }
.reveal p{ margin:0; line-height:1.4; font-weight:300; white-space:pre-wrap; }

body.locked{ position:fixed; width:100%; overflow:hidden; }

/* Admin */
.admin-area{ display:flex; flex-direction:column; gap:10px; }
.admin-list{
  width:100%;
  min-height: 220px;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,.10);
  background: rgba(0,0,0,.03);
  font: 300 13px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, Arial;
  color: var(--txt);
  white-space: pre;
}
.small{ font-size:12px; color: var(--muted); font-weight:300; }

/* FORCE les couleurs des drapeaux (override final) */
.door.gt::before{
  background: linear-gradient(90deg,
    #66B2FF 0 33.33%,
    #ffffff 33.33% 66.66%,
    #66B2FF 66.66% 100%) !important;
}

.door.fr::before{
  background: linear-gradient(90deg,
    #0055A4 0 33.33%,
    #ffffff 33.33% 66.66%,
    #EF4135 66.66% 100%) !important;
}

/* ===== Premium glossy upgrade ===== */

/* plus de profondeur */
.door{
  box-shadow:
    0 20px 45px rgba(0,0,0,.14),
    0 8px 18px rgba(0,0,0,.10),
    inset 0 2px 0 rgba(255,255,255,.70),
    inset 0 -14px 26px rgba(0,0,0,.16) !important;
}

/* highlight animé léger (vernis) */
@keyframes glossMove{
  0%   { transform: translateX(-18%) translateY(-10%) rotate(-18deg); opacity:.15; }
  100% { transform: translateX(18%)  translateY(6%)  rotate(-18deg); opacity:.15; }
}

/* couche de gloss qui bouge un peu */
.door::after{
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.75), rgba(255,255,255,0) 55%),
    linear-gradient(180deg, rgba(255,255,255,.30), rgba(255,255,255,0) 55%),
    linear-gradient(120deg, rgba(255,255,255,0) 35%, rgba(255,255,255,.35) 50%, rgba(255,255,255,0) 65%) !important;
  animation: glossMove 10.8s ease-in-out infinite alternate
}

/* ===== Etat ouvert plus joli ===== */

/* on garde un aperçu du drapeau derrière, très léger */
.door.open{
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,.95), rgba(255,255,255,.82) 40%, rgba(0,0,0,.03) 100%),
    var(--flag, #fff) !important;
}

/* on remet le numéro visible mais "soft" */
.front-number{
  position:absolute; /* au cas où */
}

.door.open .front-number{
  opacity: .45 !important;
  color: rgba(0,0,0,.35) !important;
  text-shadow: none !important;
  mix-blend-mode: normal !important;
}

/* petit check sur les cases ouvertes */
.door.open .front-number::after{
  content:"✓";
  position:absolute;
  right: 16%;
  bottom: 14%;
  font-size: clamp(12px, 2vw, 18px);
  color: rgba(0,0,0,.30);
}

/* =========================
   REVEAL plein écran
========================= */
.reveal-overlay{
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: none;
  flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom));
  background:
    radial-gradient(900px 520px at 20% 0%, rgba(102,178,255,.22), transparent 60%),
    radial-gradient(900px 520px at 85% 10%, rgba(180,220,255,.20), transparent 60%),
    radial-gradient(900px 520px at 50% 85%, rgba(120,190,255,.14), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f3f9ff 55%, #ffffff 100%);
  transform: translateY(10px);
  opacity: 0;
  transition: transform .28s ease, opacity .28s ease;
}

.reveal-overlay.show{
  display: flex;
  transform: translateY(0);
  opacity: 1;
}

.reveal-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 14px;
}

.reveal-back{
  appearance:none;
  border:none;
  border-radius: 9999px;
  padding: 10px 14px;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 10px 24px rgba(0,0,0,.10);
  font-family: "Poppins", system-ui, Arial;
  font-weight: 800;
  cursor:pointer;
}

.reveal-chip{
  padding: 8px 12px;
  border-radius: 9999px;
  background: rgba(255,255,255,.70);
  border: 1px solid rgba(0,0,0,.08);
  color: rgba(0,0,0,.60);
  font-family: "Poppins", system-ui, Arial;
  font-weight: 800;
}

.reveal-card{
  flex: 1;
  border-radius: 22px;
  background: rgba(255,255,255,.80);
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 22px 60px rgba(0,0,0,.12);
  padding: 18px;
  overflow:auto;
  text-align: center;
}

.reveal-title{
  margin: 0 0 10px 0;
  font-family: "Poppins", system-ui, Arial;
  font-weight: 800;
  font-size: clamp(22px, 5.6vw, 34px);
  color: rgba(0,0,0,.88);
  text-align: center;
}


.reveal-text{
  font-family: "Poppins", system-ui, Arial;
  font-weight: 600;
  color: rgba(0,0,0,.72);
  line-height: 1.6;
  font-size: 17px;
  white-space: pre-wrap;

  text-align: center;       /* ✅ centré */
  max-width: 44ch;          /* ✅ lecture agréable sur iPhone/iPad */
  margin: 0 auto;           /* ✅ centre la colonne */
}


/* lock scroll iOS */
body.reveal-locked{
  position: fixed;
  width: 100%;
  overflow: hidden;
}

/* Reveal plein écran - fallback sûr */
#revealOverlay{
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: none;
  flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom));
  background:
    radial-gradient(900px 520px at 20% 0%, rgba(102,178,255,.22), transparent 60%),
    radial-gradient(900px 520px at 85% 10%, rgba(180,220,255,.20), transparent 60%),
    radial-gradient(900px 520px at 50% 85%, rgba(120,190,255,.14), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f3f9ff 55%, #ffffff 100%);
}

#revealOverlay.show{ display:flex; }

#revealOverlay .reveal-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 14px;
}

#revealOverlay .reveal-card{
  flex: 1;
  border-radius: 22px;
  background: rgba(255,255,255,.80);
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 22px 60px rgba(0,0,0,.12);
  padding: 18px;
  overflow:auto;
}

/* =========================
   CODE MODAL - version clean iOS sheet
========================= */
.code-sheet{
  width: min(520px, 100%);
  margin: 0 auto;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 30px 80px rgba(0,0,0,.22);
  border-radius: 22px 22px 0 0;
  overflow: hidden;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

@media (min-width: 600px){
  .code-sheet{
    border-radius: 22px;
    margin-bottom: 24px;
  }
}

.code-grabber{
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  margin: 10px auto 6px;
}

.code-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 14px 8px;
}

.code-title{
  font-family: "Poppins", system-ui, Arial;
  font-weight: 800;
  font-size: 18px;
  color: rgba(0,0,0,.86);
}

.code-close{
  appearance:none;
  border:none;
  background: rgba(0,0,0,.05);
  border: 1px solid rgba(0,0,0,.08);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.code-body{
  padding: 12px 14px 14px;
  display:flex;
  flex-direction:column;
  gap: 10px;
  align-items: center;
}

.code-input{
  width: 100%;
  max-width: 420px;
  text-align: center;
  font-family: "Poppins", system-ui, Arial;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 6px;

  padding: 14px 12px;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(0,0,0,.03);
  outline: none;
}

.code-input:focus{
  border-color: rgba(102,178,255,.85);
  box-shadow: 0 0 0 5px rgba(102,178,255,.20);
}

.code-primary{
  width: 100%;
  max-width: 420px;
  appearance:none;
  border:none;
  border-radius: 18px;
  padding: 14px 14px;
  font-family: "Poppins", system-ui, Arial;
  font-weight: 800;
  font-size: 16px;
  color: white;
  background: linear-gradient(180deg, #66B2FF, #2E7DFF);
  box-shadow: 0 14px 30px rgba(46,125,255,.25);
  cursor:pointer;
}

.code-primary:active{ transform: translateY(1px); }

.code-secondary{
  width: 100%;
  max-width: 420px;
  appearance:none;
  border:none;
  border-radius: 18px;
  padding: 12px 14px;
  font-family: "Poppins", system-ui, Arial;
  font-weight: 700;
  font-size: 15px;
  color: rgba(0,0,0,.70);
  background: rgba(0,0,0,.05);
  border: 1px solid rgba(0,0,0,.08);
  cursor:pointer;
}

/* ===== Warm postcard style for code modal ===== */

/* overlay un peu plus doux */
#overlay{
  background: rgba(30, 20, 10, .35) !important;
}

/* carte crème + ombre douce */
.code-sheet{
  background: rgba(255, 248, 240, .96) !important;  /* crème */
  border: 1px solid rgba(120, 70, 40, .16) !important;
  box-shadow: 0 26px 80px rgba(30, 20, 10, .28) !important;
  border-radius: 26px !important;
}

/* petit “grain papier” subtil */
.code-sheet::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: 26px;
  pointer-events:none;
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.55), transparent 55%),
    radial-gradient(circle at 80% 30%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(circle at 40% 90%, rgba(0,0,0,.03), transparent 55%);
  mix-blend-mode: normal;
  opacity:.9;
}

/* le titre plus “carte” */
.code-title{
  font-family: "Fraunces", "Poppins", system-ui, Arial !important;
  font-weight: 800 !important;
  color: rgba(70, 35, 18, .92) !important;
}

/* bouton fermer plus doux */
.code-close{
  background: rgba(120, 70, 40, .06) !important;
  border: 1px solid rgba(120, 70, 40, .14) !important;
}

/* input plus “chaleureux” */
.code-input{
  background: rgba(120, 70, 40, .05) !important;
  border: 1px solid rgba(120, 70, 40, .16) !important;
  letter-spacing: 5px !important;
}

.code-input:focus{
  border-color: rgba(249, 115, 22, .55) !important; /* orange doux */
  box-shadow: 0 0 0 6px rgba(249, 115, 22, .18) !important;
}

/* bouton principal style “coucher de soleil” */
.code-primary{
  background: linear-gradient(180deg, #fb923c, #f97316) !important;
  box-shadow: 0 16px 34px rgba(249,115,22,.28) !important;
}

/* bouton annuler plus “papier” */
.code-secondary{
  background: rgba(255,255,255,.55) !important;
  border: 1px solid rgba(120, 70, 40, .16) !important;
}

/* FORCE style du titre (au cas où) */
.page-title,
h1#title{
  font-family: "Fraunces", "Poppins", system-ui, Arial !important;
  font-weight: 800 !important;
  font-size: clamp(36px, 7.8vw, 60px) !important;
  letter-spacing: .2px !important;
  color: rgba(35, 20, 10, .92) !important;
  text-align: center !important;
}

/* =========================
   STYLE B — Carte postale / Voyage
========================= */

/* Fond papier + taches très légères */
body{
  background:
    radial-gradient(900px 520px at 18% 0%, rgba(102,178,255,.14), transparent 60%),
    radial-gradient(900px 520px at 85% 10%, rgba(180,220,255,.12), transparent 60%),
    radial-gradient(900px 520px at 60% 92%, rgba(249,115,22,.10), transparent 60%),
    linear-gradient(180deg, #fffaf3 0%, #f6fbff 55%, #fffaf3 100%) !important;
}

/* Petit “papier grain” subtil */
body::before{
  content:"";
  position: fixed;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(circle at 15% 25%, rgba(0,0,0,.03), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,.025), transparent 60%),
    radial-gradient(circle at 40% 90%, rgba(0,0,0,.02), transparent 65%);
  opacity:.55;
}

/* Titre style carte postale */
.page-title,
h1#title{
  font-family: "Fraunces", "Poppins", system-ui, Arial !important;
  letter-spacing: .2px !important;
}

/* Progress plus “postcard” */
.progress{
  font-family: "Poppins", system-ui, Arial !important;
  font-weight: 700 !important;
  color: rgba(80, 45, 25, .55) !important;
}

/* Cases: un peu plus “badge timbre” */
.door{
  border: 1px solid rgba(120, 70, 40, .14) !important;
  box-shadow:
    0 18px 45px rgba(30, 20, 10, .16),
    inset 0 2px 0 rgba(255,255,255,.70),
    inset 0 -14px 26px rgba(0,0,0,.14) !important;
}

/* Petit anneau clair autour pour style “médaillon” */
.door{
  outline: 3px solid rgba(255,255,255,.55);
  outline-offset: -6px;
}


/* Modal code : style carte postale */
#overlay{ background: rgba(35, 20, 10, .38) !important; }

.code-sheet{
  background: rgba(255,248,240,.96) !important;
  border: 1px solid rgba(120,70,40,.16) !important;
  box-shadow: 0 30px 90px rgba(30,20,10,.30) !important;
  border-radius: 26px !important;
}

.code-title{
  font-family: "Fraunces", "Poppins", system-ui, Arial !important;
  color: rgba(70,35,18,.92) !important;
}

.code-primary{
  background: linear-gradient(180deg, #fb923c, #f97316) !important;
  box-shadow: 0 16px 34px rgba(249,115,22,.28) !important;
}

/* Reveal : look postcard */
#revealOverlay .reveal-card{
  background: rgba(255,248,240,.88) !important;
  border: 1px solid rgba(120,70,40,.14) !important;
}

#revealOverlay .reveal-title{
  font-family: "Fraunces", "Poppins", system-ui, Arial !important;
  color: rgba(70,35,18,.92) !important;
}

#revealOverlay .reveal-text{
  color: rgba(70,35,18,.72) !important;
}

/* ===== FORCE FOND POSTCARD (override final) ===== */
html, body{
  background:
    radial-gradient(900px 520px at 18% 0%, rgba(102,178,255,.14), transparent 60%),
    radial-gradient(900px 520px at 85% 10%, rgba(180,220,255,.12), transparent 60%),
    radial-gradient(900px 520px at 60% 92%, rgba(249,115,22,.10), transparent 60%),
    linear-gradient(180deg, #fffaf3 0%, #f6fbff 55%, #fffaf3 100%) !important;
}

body{
  position: relative;
}

/* grain papier léger */
body::before{
  content:"";
  position: fixed;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(circle at 15% 25%, rgba(0,0,0,.03), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,.025), transparent 60%),
    radial-gradient(circle at 40% 90%, rgba(0,0,0,.02), transparent 65%);
  opacity:.55;
  z-index: -1;
}

/* ===== FOND CHALEUREUX (beige / jaune / brun / orange) ===== */
html, body{
  background:
    radial-gradient(900px 520px at 18% 0%, rgba(251,146,60,.22), transparent 60%),   /* orange doux */
    radial-gradient(900px 520px at 85% 10%, rgba(245,158,11,.18), transparent 60%),  /* jaune miel */
    radial-gradient(900px 520px at 55% 92%, rgba(120,70,40,.18), transparent 60%),   /* brun cacao */
    linear-gradient(180deg, #fff2df 0%, #fff7ea 40%, #fff2df 100%) !important;       /* papier crème */
}

body{
  position: relative;
}

/* Grain papier subtil */
body::before{
  content:"";
  position: fixed;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(circle at 18% 22%, rgba(120,70,40,.06), transparent 55%),
    radial-gradient(circle at 82% 70%, rgba(120,70,40,.05), transparent 60%),
    radial-gradient(circle at 45% 92%, rgba(0,0,0,.03), transparent 65%);
  opacity:.55;
  z-index: -1;
}

/* ===== FOND CHALEUREUX SANS GRADIENT (uni + grain) ===== */
html, body{
  background: #fff1de !important; /* crème chaud */
}

body{
  position: relative;
}

/* grain papier (pas de gradient, juste texture) */
body::before{
  content:"";
  position: fixed;
  inset:0;
  pointer-events:none;

  /* petites "poussières" / grain très discret */
  background:
    radial-gradient(circle, rgba(120,70,40,.035) 1px, transparent 1.2px),
    radial-gradient(circle, rgba(120,70,40,.025) 1px, transparent 1.2px);

  background-size: 22px 22px, 34px 34px;
  background-position: 0 0, 10px 14px;

  opacity: .35;
  z-index: -1;
}
html, body{
  background: #F6E6CF !important; /* papier chaud */
}

body::before,
body::after{
  content: none !important;
}
/* Panneau clair derrière la grille : réduit le clash avec le fond */
.wrap{
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(120,70,40,.10);
  border-radius: 26px;
  padding: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,.08);
  backdrop-filter: blur(6px);
}
/* Drapeaux un peu moins agressifs sur fond warm */
.door.gt::before,
.door.fr::before{
  filter: saturate(.92) contrast(.98) brightness(1.02);
}
html, body{ background: #FBF4E8 !important; }

@font-face {
  font-family: "AuBordDeLaSeine";
  src: url("./fonts/AuBordDeLaSeine.ttf") format("truetype");
  font-display: swap;
}

.page-title, h1#title{
  font-family: "AuBordDeLaSeine", "Poppins", system-ui, Arial !important;
}

#revealOverlay .reveal-title{
  font-family: "AuBordDeLaSeine", "Poppins", system-ui, Arial !important;
}


/* Sur iPad/écrans larges : contour un peu plus fin */
@media (min-width: 768px){
  .page-title,
  h1#title{
    -webkit-text-stroke: 0.1px rgba(120, 70, 40, .50);
  }
}
@font-face{
  font-family: "ValentineWildflowerSans";
  src: url("./fonts/ValentineWildflowerSansDemo.otf") format("opentype");
  font-display: swap;
}
.page-title, h1#title{
  font-family: "ValentineWildflowerSans", "Poppins", system-ui, Arial !important;
}

/* ===== Titre ton-sur-ton (même couleur que le panneau) + ombre, sans contour ===== */
.page-title, h1#title{
  /* couleur proche du panneau clair derrière la grille */
  color: rgba(246,230,207,.92) !important;

  /* pas de contour */
  -webkit-text-stroke: 0 transparent !important;

  /* ombre douce pour le faire ressortir */
  text-shadow:
    0 10px 24px rgba(30,20,10,.18),
    0 2px 0 rgba(30,20,10,.06);

  /* garde ta nouvelle police */
  font-family: "ValentineWildflowerSans", "Poppins", system-ui, Arial !important;

  /* un peu plus lisible */
  letter-spacing: .6px !important;
}


/* ===== TITRE : ton sur ton carte + ombre (sans contour) ===== */
.page-title, h1#title{
  font-family: "ValentineWildflowerSans", "Poppins", system-ui, Arial !important;

  /* même famille de couleur que la carte */
  color: rgba(255, 255, 255, .78) !important;

  /* pas de contour */
  -webkit-text-stroke: 0 transparent !important;

  /* ombre pour le faire ressortir sans “outline” */
  text-shadow:
    0 18px 36px rgba(30, 20, 10, .18),
    0 3px 0 rgba(30, 20, 10, .06);

  /* lisibilité + */
  letter-spacing: .6px !important;
  line-height: 1.05 !important;

  /* léger fond “glow” subtil */
  filter: drop-shadow(0 8px 18px rgba(251,146,60,.12));
}

/* ===== TITRE : ton sur ton + ombre courte (pas de gros halo) ===== */
.page-title, h1#title{
  font-family: "ValentineWildflowerSans", "Poppins", system-ui, Arial !important;

  /* ton sur ton avec la carte */
  color: rgba(255, 255, 255, 0.92) !important;


  /* aucun contour */
  -webkit-text-stroke: 0 transparent !important;

  /* ombre courte et nette (pas de halo) */
  text-shadow:
    0 2px 0 rgba(120, 70, 40, .18),
    0 6px 14px rgba(30, 20, 10, .10);

  letter-spacing: .6px !important;
  line-height: 1.05 !important;
}

/* ===== TITRE : base commune ===== */
.page-title, h1#title{
  font-family: "ValentineWildflowerSans", "Poppins", system-ui, Arial !important;
  letter-spacing: .6px !important;
  line-height: 1.05 !important;
  -webkit-text-stroke: 0 transparent !important; /* pas de contour */
}

.page-title, h1#title{
  color: rgba(158, 170, 210, 0.52) !important;  /* taupe */
  text-shadow:
    0 1px 0 rgba(255,255,255,.30),
    0 6px 14px rgba(30,20,10,.08);
}
/* =========================
   FINAL LOOK (warm + cadeau)
========================= */

/* Fond chaud uni */
html, body{
  background: #F6E6CF !important; /* papier chaud */
}

/* Panneau derrière la grille (réduit clash avec drapeaux) */
.wrap{
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(120,70,40,.10);
  border-radius: 28px;
  padding: 14px;
  box-shadow: 0 18px 55px rgba(30,20,10,.10);
}

/* Titre : encre douce (compatible avec tout: fond + drapeaux) */
.page-title, h1#title{
  font-family: "ValentineWildflowerSans", "Poppins", system-ui, Arial !important;
  color: rgba(92, 58, 36, .62) !important; /* brun encre */
  -webkit-text-stroke: 0 transparent !important;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
  letter-spacing: .6px !important;
  line-height: 1.05 !important;
  text-align: center !important;
}

/* Cases : un peu moins “agressives”, plus premium */
.door.gt::before, .door.fr::before{
  filter: saturate(.92) contrast(.98) brightness(1.02);
}

/* Reveal plein écran : carte papier warm */
#revealOverlay .reveal-card{
  background: rgba(255, 248, 240, .92) !important;
  border: 1px solid rgba(120,70,40,.14) !important;
}
#revealOverlay .reveal-title{
  font-family: "ValentineWildflowerSans", "Poppins", system-ui, Arial !important;
  color: rgba(92, 58, 36, .78) !important;
}
#revealOverlay .reveal-text{
  text-align:center;
  max-width: 48ch;
  margin: 0 auto;
  color: rgba(92, 58, 36, .70) !important;
}

/* Modal code : warm */
#overlay{ background: rgba(45, 25, 10, .38) !important; }
.code-sheet{
  background: rgba(255,248,240,.96) !important;
  border: 1px solid rgba(120,70,40,.16) !important;
  box-shadow: 0 30px 90px rgba(30,20,10,.28) !important;
}
.code-primary{
  background: linear-gradient(180deg, #fb923c, #f97316) !important;
  box-shadow: 0 16px 34px rgba(249,115,22,.28) !important;
}

/* =========================
   IOS CLEAN OVERRIDE (white/blue)
   Colle tout en bas du fichier
========================= */

:root{
  --ios-bg: #ffffff;
  --ios-card: rgba(255,255,255,.78);
  --ios-line: rgba(0,0,0,.10);
  --ios-text: rgba(0,0,0,.88);
  --ios-muted: rgba(0,0,0,.55);
  --ios-blue1: #66B2FF;
  --ios-blue2: #2E7DFF;
}

/* Fond clean */
html, body{
  background: var(--ios-bg) !important;
}

body::before, body::after{
  content: none !important; /* enlève grain/effets warm */
}

/* Panneau derrière la grille (glass léger) */
.wrap{
  background: var(--ios-card) !important;
  border: 1px solid var(--ios-line) !important;
  border-radius: 28px !important;
  padding: 14px !important;
  box-shadow: 0 18px 55px rgba(0,0,0,.10) !important;
  backdrop-filter: blur(8px);
}

/* Titre propre (pas warm) */
/* Titre neutre iOS */
.page-title, h1#title{
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               "Inter", system-ui, Segoe UI, Roboto, Arial !important;
  font-weight: 800 !important;
  letter-spacing: .2px !important;
}


/* Drapeaux un peu plus “pop” sur fond blanc */
.door.gt::before, .door.fr::before{
  filter: saturate(1.02) contrast(1.02) brightness(1.02) !important;
}

/* Modal code : clean bleu */
#overlay{ background: rgba(0,0,0,.35) !important; }

.code-sheet{
  background: rgba(255,255,255,.92) !important;
  border: 1px solid rgba(0,0,0,.10) !important;
  box-shadow: 0 30px 90px rgba(0,0,0,.22) !important;
}

.code-title{
  color: var(--ios-text) !important;
}

.code-input:focus{
  border-color: rgba(46,125,255,.75) !important;
  box-shadow: 0 0 0 5px rgba(46,125,255,.18) !important;
}

.code-primary{
  background: linear-gradient(180deg, var(--ios-blue1), var(--ios-blue2)) !important;
  box-shadow: 0 16px 34px rgba(46,125,255,.25) !important;
}

/* Reveal plein écran : clean blanc/bleu */
#revealOverlay .reveal-card{
  background: rgba(255,255,255,.82) !important;
  border: 1px solid rgba(0,0,0,.08) !important;
  box-shadow: 0 22px 60px rgba(0,0,0,.12) !important;
}

#revealOverlay .reveal-title{
  font-family: "ValentineWildflowerSans", "Poppins", system-ui, Arial !important;
  color: rgba(0,0,0,.84) !important;
  text-shadow: 0 10px 28px rgba(102,178,255,.16) !important;
}

#revealOverlay .reveal-text{
  color: rgba(0,0,0,.70) !important;
}
/* ===== Header plus grand (titre + sous-titre) ===== */
.topbar{
  padding-top: calc(10px + env(safe-area-inset-top));
  padding-bottom: 10px;
  margin: 0 auto 14px;
  max-width: 1100px;
}

.page-title{
  margin: 0;
  text-align: center;
  font-size: clamp(40px, 8.5vw, 68px);
  font-weight: 800;
  line-height: 1.0;
}

.page-subtitle{
  margin-top: 6px;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, Arial;
  font-size: clamp(14px, 3.8vw, 18px);
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(0,0,0,.55);
}
.topbar{
  display: block !important;
  text-align: center !important;
}

.page-subtitle{
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
/* Empêche les effets (pseudo-elements) de bloquer les clics */
.code-sheet{ position: relative; }
.code-sheet::before,
.code-sheet::after{ pointer-events: none !important; }

.code-close,
.code-secondary,
.code-primary{ pointer-events: auto !important; }

/* Assure que les clics passent bien */
#overlay{ pointer-events: auto; }
.code-sheet{ position: relative; pointer-events: auto; z-index: 2; }
.code-close, .code-secondary, .code-primary{ pointer-events: auto; }

/* Empêche les couches décoratives de bloquer les clics du bouton retour */
#revealOverlay{ pointer-events: auto; }
#revealOverlay .reveal-top{ pointer-events: auto; }
#revealOverlay .reveal-back{ pointer-events: auto; position: relative; z-index: 5; }
#revealOverlay .reveal-card{ pointer-events: auto; }

/* === FORCE clic sur le bouton Retour === */
#revealOverlay { pointer-events: auto; }
#revealOverlay .reveal-top { position: relative; z-index: 9999; pointer-events: auto; }
#revealOverlay .reveal-back { position: relative; z-index: 9999; pointer-events: auto; }

/* ===== Sélection pays + bouton retour ===== */
.topbar{ position: relative; }

.top-back{
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(2px);
  appearance: none;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.75);
  border-radius: 999px;
  width: 42px;
  height: 42px;
  font-weight: 900;
  cursor: pointer;
  display: none; /* affiché uniquement quand on est dans une page pays */
}

.country-screen{
  max-width: 900px;
  margin: 0 auto 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 720px){
  .country-screen{ grid-template-columns: 1fr; }
}

.country-card{
  appearance: none;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.78);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 18px 55px rgba(0,0,0,.10);
  text-align: left;
  cursor: pointer;
}

.country-flag{
  width: 100%;
  height: 82px;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
  margin-bottom: 10px;
}

.country-flag.gt{
  background: linear-gradient(90deg, #66B2FF 0 33.33%, #fff 33.33% 66.66%, #66B2FF 66.66% 100%);
}
.country-flag.fr{
  background: linear-gradient(90deg, #0055A4 0 33.33%, #fff 33.33% 66.66%, #EF4135 66.66% 100%);
}

.country-name{
  font-weight: 900;
  font-size: 20px;
  margin-bottom: 4px;
}

.country-sub{
  color: rgba(0,0,0,.55);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* On cache la grille quand on est sur l'écran de choix */
body.on-country-screen #mainWrap{ display: none; }
body.on-country-screen .top-back{ display: none; }

/* On cache l'écran de choix quand on est sur une page pays */
body.on-country-page #countryScreen{ display: none; }
body.on-country-page .top-back{ display: inline-flex; align-items:center; justify-content:center; }

.topbar{ position: relative; }

.top-back{
  position: absolute;
  left: 0;
  top: 0;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.85);
  font-weight: 900;
  cursor: pointer;
  display: none; /* caché par défaut */
  align-items: center;
  justify-content: center;
}

/* Quand tu es sur l'écran de choix -> pas de bouton */
body.on-country-screen .top-back{ display: none; }

/* Quand tu es sur une page pays -> bouton visible */
body.on-country-page .top-back{ display: inline-flex; }

.top-back{
  position: absolute;
  z-index: 99999;
  pointer-events: auto;
}

/* Choix pays: plus carré */
.country-card{
  border-radius: 14px !important;   /* avant: très arrondi */
}

.country-flag{
  border-radius: 10px !important;   /* drapeau moins arrondi aussi */
}
.country-card{ border-radius: 10px !important; }
.country-flag{ border-radius: 8px !important; }

/* Choix pays: cartes plus longues (layout horizontal) */
.country-card{
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 14px 16px !important;
  min-height: 92px;          /* rend la carte plus “longue” */
}

/* Le drapeau devient un bloc à gauche (pas full width) */
.country-flag{
  width: 140px !important;
  height: 72px !important;
  margin-bottom: 0 !important;
  flex: 0 0 140px !important;
  border-radius: 12px !important;
}

/* Texte à droite */
.country-name{
  margin: 0 !important;
  font-size: 20px !important;
}

.country-sub{
  margin-top: 4px !important;
}
/* ===== Écran choix pays : 2 blocs plein écran + drapeau centré ===== */

/* la section des choix prend (presque) tout l'écran */
.country-screen{
  max-width: 900px;
  margin: 0 auto 14px;

  display: flex;
  flex-direction: column;
  gap: 12px;

  /* iPhone-friendly: svh évite le bug de barre Safari */
  min-height: calc(100svh - 170px);
  min-height: calc(100vh - 170px);
}

/* chaque bouton = 1 bloc qui prend la moitié de l'espace */
.country-card{
  flex: 1;
  position: relative;

  border-radius: 22px;         /* garde un look clean */
  padding: 18px;
  overflow: hidden;

  display: block;              /* on laisse le contenu en absolute */
}

/* drapeau parfaitement centré */
.country-flag{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);

  width: clamp(220px, 70vw, 520px);
  aspect-ratio: 4 / 3;         /* joli rectangle */
  height: auto;

  margin: 0 !important;
  border-radius: 18px;
}

/* texte en bas, centré (optionnel mais beau) */
.country-name{
  position: absolute;
  left: 0; right: 0;
  bottom: 34px;
  text-align: center;
  margin: 0 !important;
}

.country-sub{
  position: absolute;
  left: 0; right: 0;
  bottom: 16px;
  text-align: center;
  margin: 0 !important;
}

/* sur grands écrans: côte à côte (remplit toujours bien) */
@media (min-width: 900px){
  .country-screen{ flex-direction: row; }
  .country-card{ min-height: 360px; }
}

/* ===== FORCE: drapeaux géants centrés dans les 2 blocs ===== */
.country-screen .country-card{
  position: relative !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.country-screen .country-flag{
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;

  width: 88% !important;      /* <- TRÈS GRAND */
  height: 70% !important;     /* <- TRÈS GRAND */
  margin: 0 !important;

  flex: none !important;      /* annule les anciens flex-basis */
  border-radius: 18px !important;
}

/* option: texte en bas (si tu veux le garder) */
.country-screen .country-name{
  position: absolute !important;
  left: 0; right: 0;
  bottom: 34px;
  text-align: center;
}
.country-screen .country-sub{
  position: absolute !important;
  left: 0; right: 0;
  bottom: 14px;
  text-align: center;
}

/* ===== FORCE: drapeaux géants centrés dans les 2 blocs ===== */
.country-screen .country-card{
  position: relative !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.country-screen .country-flag{
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;

  width: 92% !important;      /* <- TRÈS GRAND */
  height: 72% !important;     /* <- TRÈS GRAND */
  margin: 0 !important;

  flex: none !important;      /* annule les anciens flex-basis */
  border-radius: 18px !important;
}

/* option: texte en bas (si tu veux le garder) */
.country-screen .country-name{
  position: absolute !important;
  left: 0; right: 0;
  bottom: 34px;
  text-align: center;
}
.country-screen .country-sub{
  position: absolute !important;
  left: 0; right: 0;
  bottom: 14px;
  text-align: center;
}
/* iPhone: empêcher le bleu par défaut des <button> */
.country-card{
  -webkit-appearance: none;
  appearance: none;
  color: rgba(0,0,0,.88) !important;  /* ou la couleur que tu veux */
}

.country-name,
.country-sub{
  color: inherit !important;
  -webkit-text-fill-color: currentColor; /* iOS fix */
}
/* ===== iPhone: éviter que les titres chevauchent le drapeau ===== */
@media (max-width: 720px){
  .country-card{
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
  }

  /* Le drapeau n'est plus en absolute => plus d'overlap */
  .country-flag{
    position: static !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;

    width: 92% !important;
    max-width: 520px !important;
    aspect-ratio: 3 / 2 !important;
    height: auto !important;

    margin: 8px 0 12px 0 !important;
  }

  /* Titres en flow normal sous le drapeau */
  .country-name{
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;

    margin: 0 !important;
    text-align: center !important;
    font-size: 20px !important;
  }

  .country-sub{
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;

    margin: 6px 0 0 0 !important;
    text-align: center !important;
  }
}
/* ===== iPhone: drapeau centré + texte en bas (sans overlap) ===== */
@media (max-width: 720px){
  .country-card{
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 16px !important;
    min-height: 240px !important;     /* donne de l’espace pour “texte en bas” */
  }

  /* drapeau en flow normal (pas absolute) */
  .country-flag{
    position: static !important;
    transform: none !important;

    width: 92% !important;
    max-width: 520px !important;
    aspect-ratio: 3 / 2 !important;
    height: auto !important;

    margin: 10px 0 14px 0 !important;
  }

  /* pousse le titre + sous-titre vers le bas */
  .country-name{
    margin-top: auto !important;   /* <- clé : colle en bas */
    margin-bottom: 4px !important;
    text-align: center !important;
  }

  .country-sub{
    margin: 0 0 6px 0 !important;  /* petit espace du bas */
    text-align: center !important;
  }
}
/* ===== iPhone: drapeau centré + texte en bas (sans overlap) ===== */
@media (max-width: 720px){
  .country-card{
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 16px !important;
    min-height: 240px !important;     /* donne de l’espace pour “texte en bas” */
  }

  /* drapeau en flow normal (pas absolute) */
  .country-flag{
    position: static !important;
    transform: none !important;

    width: 92% !important;
    max-width: 520px !important;
    aspect-ratio: 3 / 2 !important;
    height: auto !important;

    margin: 10px 0 14px 0 !important;
  }

  /* pousse le titre + sous-titre vers le bas */
  .country-name{
    margin-top: auto !important;   /* <- clé : colle en bas */
    margin-bottom: 4px !important;
    text-align: center !important;
  }

  .country-sub{
    margin: 0 0 6px 0 !important;  /* petit espace du bas */
    text-align: center !important;
  }
}
/* ===== iPhone: drapeau centré + texte en bas (sans overlap) ===== */
@media (max-width: 720px){
  .country-card{
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 16px !important;
    min-height: 240px !important;     /* donne de l’espace pour “texte en bas” */
  }

  /* drapeau en flow normal (pas absolute) */
  .country-flag{
    position: static !important;
    transform: none !important;

    width: 92% !important;
    max-width: 520px !important;
    aspect-ratio: 3 / 2 !important;
    height: auto !important;

    margin: 10px 0 14px 0 !important;
  }

  /* pousse le titre + sous-titre vers le bas */
  .country-name{
    margin-top: auto !important;   /* <- clé : colle en bas */
    margin-bottom: 4px !important;
    text-align: center !important;
  }

  .country-sub{
    margin: 0 0 6px 0 !important;  /* petit espace du bas */
    text-align: center !important;
  }
}
/* ===== iPhone FIX FINAL : drapeau centré + texte en bas (sans overlap) ===== */
@media (max-width: 720px){

  .country-card{
    position: relative !important;
    display: block !important;
    padding: 16px 16px 74px 16px !important; /* réserve la zone texte en bas */
    min-height: 260px !important;
    overflow: hidden !important;
  }

  /* drapeau centré mais un peu plus haut pour laisser la zone texte en bas */
  .country-flag{
    position: absolute !important;
    left: 50% !important;
    top: 46% !important;
    transform: translate(-50%, -50%) !important;

    width: 92% !important;
    height: 62% !important;           /* <- ne descend pas dans la zone texte */
    margin: 0 !important;

    border-radius: 18px !important;
  }

  /* texte forcé en bas */
  .country-name{
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 40px !important;
    margin: 0 !important;
    text-align: center !important;
    z-index: 5 !important;
  }

  .country-sub{
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 16px !important;
    margin: 0 !important;
    text-align: center !important;
    z-index: 5 !important;
  }
}

/* ===== iPhone: drapeau un peu plus petit pour éviter overlap texte ===== */
@media (max-width: 720px){
  .country-card{
    padding-bottom: 86px !important;  /* plus de place pour le texte */
    min-height: 260px !important;
  }

  .country-flag{
    top: 42% !important;             /* un peu plus haut */
    height: 54% !important;          /* un peu plus petit */
    width: 90% !important;           /* légèrement moins large */
  }
}
/* ===== iPhone FINAL OVERRIDE : drapeau + texte sans overlap (ultra spécifique) ===== */
@media (max-width: 720px){

  /* réserve une zone texte plus grande en bas */
  .country-screen .country-card{
    position: relative !important;
    display: block !important;
    overflow: hidden !important;
    min-height: 280px !important;
    padding: 16px 16px 110px 16px !important; /* zone texte plus grande */
  }

  /* drapeau plus petit + plus haut */
  .country-screen .country-card .country-flag{
    position: absolute !important;
    left: 50% !important;
    top: 41% !important;
    transform: translate(-50%, -50%) !important;

    width: 88% !important;
    height: 74% !important;
    margin: 0 !important;

    border-radius: 18px !important;
  }

  /* texte forcé en bas, au-dessus de tout */
  .country-screen .country-card .country-name{
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 36px !important;
    margin: 0 !important;
    text-align: center !important;
    z-index: 9999 !important;
  }

  .country-screen .country-card .country-sub{
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 20px !important;
    margin: 0 !important;
    text-align: center !important;
    z-index: 9999 !important;
  }
}

/* ===== Flèche retour stylée (noir) ===== */
#backToCountries.top-back{
  width: 44px !important;
  height: 44px !important;
  border-radius: 999px !important;

  background: rgba(255,255,255,.85) !important;
  border: 1px solid rgba(0,0,0,.14) !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.12) !important;

  color: rgba(0,0,0,.88) !important;
  font-size: 34px !important;
  font-weight: 900 !important;
  line-height: 1 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#backToCountries.top-back:active{
  transform: translateY(1px) !important;
}
/* ===== Flèche retour plus discrète + cachée sur l'accueil ===== */

/* Taille + style plus léger */
#backToCountries.top-back{
  width: 36px !important;
  height: 36px !important;
  border-radius: 999px !important;

  background: rgba(255,255,255,.80) !important;
  border: 1px solid rgba(0,0,0,.12) !important;
  box-shadow: 0 8px 18px rgba(0,0,0,.10) !important;

  color: rgba(0,0,0,.88) !important;
  font-size: 28px !important;
  font-weight: 900 !important;
  line-height: 1 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#backToCountries.top-back:active{
  transform: translateY(1px) !important;
}

/* Caché sur la page d'accueil (écran de choix) */
body.on-country-screen #backToCountries{
  display: none !important;
}

/* Visible seulement sur les pages pays */
body.on-country-page #backToCountries{
  display: inline-flex !important;
}

/* ===== HOME SCREEN ===== */
.home-screen{
  max-width: 900px;
  margin: 0 auto 14px;
  min-height: calc(100svh - 220px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-card{
  width: 100%;
  max-width: 560px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 18px 55px rgba(0,0,0,.10);
  text-align: center;
}

.home-title{
  margin: 0 0 6px 0;
  font-weight: 900;
  font-size: clamp(22px, 6vw, 30px);
}

.home-sub{
  margin: 0 0 14px 0;
  color: rgba(0,0,0,.55);
  font-weight: 600;
  line-height: 1.35;
}

.home-btn{
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 14px 14px;
  font-weight: 800;
  cursor: pointer;
}

.home-primary{
  background: linear-gradient(180deg, #66B2FF, #2E7DFF);
  color: white;
  box-shadow: 0 16px 34px rgba(46,125,255,.25);
  margin-bottom: 10px;
}
.home-primary:active{ transform: translateY(1px); }

.home-secondary{
  background: rgba(0,0,0,.05);
  border: 1px solid rgba(0,0,0,.10);
  color: rgba(0,0,0,.80);
}
.home-secondary:active{ transform: translateY(1px); }

/* ===== États d'affichage ===== */
body.on-home #countryScreen{ display: none !important; }
body.on-home #mainWrap{ display: none !important; }

body.on-country-screen #homeScreen{ display: none !important; }
body.on-country-page #homeScreen{ display: none !important; }

/* ===== Flèche: cachée sur Home, visible sur choix drapeaux + pages pays ===== */

/* Jamais sur la page d'accueil */
body.on-home #backToCountries{
  display: none !important;
}

/* Visible sur la page de choix des drapeaux */
body.on-country-screen #backToCountries{
  display: inline-flex !important;
}

/* Visible aussi sur les pages pays (si tu veux la garder) */
body.on-country-page #backToCountries{
  display: inline-flex !important;
}
/* Même typo que le grand titre pour le titre de la fenêtre code */
.code-title,
#modalTitle{
  font-family: inherit;
}

/* Si ton grand titre est sur .page-title, on copie exactement sa police */
.code-title,
#modalTitle{
  font-family: var(--title-font, inherit) !important;
}

/* ===== Vidéo de fond page d'accueil ===== */
.home-bg{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  display: none;           /* cachée par défaut */
}

.home-bg-overlay{
  position: fixed;
  inset: 0;
  z-index: -1;
  display: none;           /* cachée par défaut */
  background: rgba(0,0,0,.22); /* assombrit un peu pour lire le texte */
}

/* visible uniquement sur la home */
body.on-home .home-bg,
body.on-home .home-bg-overlay{
  display: block;
}

/* Vidéo de fond - visible uniquement sur la Home */
.home-bg{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  display: none;
}

.home-bg-overlay{
  position: fixed;
  inset: 0;
  z-index: -1;
  display: none;
  background: rgba(0,0,0,0);
}

/* IMPORTANT: sur home -> on montre la vidéo */
body.on-home .home-bg,
body.on-home .home-bg-overlay{
  display: block;
}

/* IMPORTANT: sur home -> on rend le fond du body transparent */
body.on-home{
  background: transparent !important;
}
/* ===== HOME: enlever le bloc, mettre 2 boutons en bas ===== */

/* Descendre le header (titre) sur la home */
body.on-home .topbar{
  padding-top: calc(30px + env(safe-area-inset-top)) !important;
  margin-bottom: 0 !important;
}

/* Home screen occupe l’écran, boutons en bas */
.home-screen{
  max-width: 900px;
  margin: 0 auto;
  min-height: calc(100svh - 180px);
  display: flex;
  align-items: flex-end;  /* boutons en bas */
  justify-content: center;
  padding: 0 14px 18px 14px;
}

/* Conteneur des boutons */
.home-actions{
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Boutons (lisibles sur vidéo) */
.home-btn{
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 14px 14px;
  font-weight: 800;
  cursor: pointer;
}


.home-primary,
.home-secondary{
  background: rgba(255,255,255,.70);
  border: 1px solid rgba(255,255,255,.35);
  color: rgba(0,0,0,.85);
  box-shadow: 0 12px 26px rgba(0,0,0,.14);
  backdrop-filter: blur(8px);
}


/* Un peu de blur pour faire “glass” sur iPhone compatible */
.home-primary, .home-secondary{
  backdrop-filter: blur(8px);
}

/* Page choix drapeaux : pas de sous-titre */
body.on-country-screen #subtitle{
  display: none !important;
}

/* Page choix drapeaux : titre plus gros */
body.on-country-screen #title{
  font-size: clamp(42px, 9vw, 72px) !important;
}

/* ===== Photos derrière les drapeaux (page choix pays) ===== */
.country-card{
  position: relative;
  overflow: hidden;
}

/* photo de fond par pays */
.country-card.gt{
  background-image: url("media/guatemala.jpg") !important;
  background-size: cover !important;
  background-position: center !important;
}
.country-card.fr{
  background-image: url("media/france.jpg") !important;
  background-size: cover !important;
  background-position: center !important;
}

/* voile pour que le drapeau + texte restent lisibles */
.country-card.gt::before,
.country-card.fr::before{
  content:"";
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.18);          /* ajuste si besoin */
  z-index: 0;
}

/* tout le contenu au-dessus de la photo */
.country-card > *{
  position: relative;
  z-index: 1;
}

/* ===== Badge blanc derrière les textes (choix pays) ===== */
.country-name,
.country-sub{
  display: inline-block;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 999px;
  padding: 6px 12px;
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
}

/* petit ajustement d'espacement */
.country-sub{
  margin-top: 8px !important;
  font-size: 12px;
  letter-spacing: .12em;
}

/* ===== Badges pays plus petits et moins larges ===== */
.country-name,
.country-sub{
  display: inline-block !important;
  width: auto !important;          /* pas full width */
  max-width: 29% !important;
  padding: 2px 10px !important;    /* plus petit */
  border-radius: 999px !important;
  background: rgba(255,255,255,.78) !important;
  border: 1px solid rgba(0,0,0,.10) !important;
  box-shadow: 0 8px 18px rgba(0,0,0,.10) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Titre pays */
.country-name{
  font-size: 18px !important;
  font-weight: 800 !important;
  letter-spacing: .02em !important;
  color: rgba(0,0,0,.88) !important;
}

/* Sous-texte */
.country-sub{
  margin-top: 6px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .10em !important;
  text-transform: uppercase !important;
  color: rgba(0,0,0,.60) !important;
}

/* ===== Badges: largeur auto (différente pour chaque ligne) ===== */
.country-name,
.country-sub{
  width: fit-content !important;   /* s’adapte au texte */
  max-width: 90% !important;
}

/* IMPORTANT: enlever le centrage "full width" si tu avais left/right/bottom */
@media (max-width: 720px){
  .country-screen .country-card .country-name,
  .country-screen .country-card .country-sub{
    left: auto !important;
    right: auto !important;
  }
}
/* ===== Mobile (téléphone) : badges plus petits ===== */
@media (max-width: 720px){
  .country-name,
  .country-sub{
    padding: 3px 9px !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,.80) !important;
    box-shadow: 0 6px 14px rgba(0,0,0,.10) !important;
    max-width: 92% !important;
  }

  .country-name{
    font-size: 16px !important;
    font-weight: 800 !important;
  }

  .country-sub{
    font-size: 10px !important;
    letter-spacing: .10em !important;
    margin-top: 5px !important;
  }

  /* un peu plus de respiration en bas */
  .country-screen .country-card{
    padding-bottom: 104px !important;
  }
}
/* ===== Mobile: badges centrés pile avec le drapeau ===== */
@media (max-width: 720px){
  .country-screen .country-card .country-name,
  .country-screen .country-card .country-sub{
    position: absolute !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;  /* centre chaque badge même si largeur différente */
    text-align: center !important;
    width: fit-content !important;
    max-width: 92% !important;
  }

  /* positions en bas (ajuste si besoin) */
  .country-screen .country-card .country-name{ bottom: 30px !important; }
  .country-screen .country-card .country-sub{  bottom: 6px !important; }
}
/* ===== Fond uniquement sur la page choix drapeaux ===== */
body.on-country-screen{
  background: #fff6eb !important;   /* <-- mets la couleur ici */
}

/* ===== Même fond pour Guatemala + France (page pays) ===== */
body.on-country-page{
  background: #fff6eb !important;  /* <-- mets la couleur ici */
}

/* Centre le titre dans la fenêtre code */
#modalTitle,
.code-title{
  text-align: center !important;
  width: 100% !important;
}

/* Sans le X, on centre tout */
.code-head{
  justify-content: center !important;
}

/* ===== Reveal compact (texte court) ===== */
#revealOverlay.reveal-overlay{
  padding: calc(14px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom)) !important;
  justify-content: center; /* centre verticalement */
}

#revealOverlay .reveal-card{
  flex: 0 0 auto !important;
  width: min(620px, 100%) !important;
  margin: 0 auto !important;
  padding: 18px 18px 16px !important;
  border-radius: 22px !important;
}

#revealOverlay .reveal-text{
  max-width: 46ch !important;
}

/* Défi #X = même typo que les autres titres */
#revealOverlay .reveal-title{
  font-family: inherit !important; /* par défaut */
  font-weight: 900 !important;
  letter-spacing: .2px !important;
}

/* Si tes autres titres utilisent Fraunces/Poppins, force-le ici */
#revealOverlay .reveal-title{
  font-family: "Fraunces", "Poppins", system-ui, Arial !important;
}

/* ===== Reveal: même background que le reste ===== */
#revealOverlay.reveal-overlay,
#revealOverlay{
  background: inherit !important;      /* prend le background du body */
  background-color: inherit !important;
}

/* Reveal: même typo que les autres titres */
#revealOverlay .reveal-title{
  font-family: inherit !important;
}

/* Copie exactement la typo du grand titre */
#revealOverlay .reveal-title{
  font-family: var(--title-font, inherit) !important;
}
