/* ==========================================================
   Zouzou — styles
   ========================================================== */

:root {
  --night: #0e0d22;
  --night-2: #1b1840;
  --ink: #f5f3ff;
  --muted: rgba(245, 243, 255, 0.68);
  --line: rgba(255, 255, 255, 0.12);
  --moon: #f6e7b8;
  --moon-ink: #1b1840;
  --green: #1f9d55;
  --ios-blue: #0a84ff;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Helvetica Neue", Arial, sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --phone-scale: 0.7;
  --top: calc(72px + env(safe-area-inset-top));
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(246, 231, 184, 0.16), transparent 70%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(161, 140, 209, 0.18), transparent 70%),
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%);
  background-attachment: fixed;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Petites étoiles */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff, transparent),
    radial-gradient(1px 1px at 28% 72%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 44% 32%, #fff, transparent),
    radial-gradient(1px 1px at 63% 12%, #fff, transparent),
    radial-gradient(1px 1px at 72% 58%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 86% 26%, #fff, transparent),
    radial-gradient(1px 1px at 92% 82%, #fff, transparent),
    radial-gradient(1px 1px at 8% 90%, #fff, transparent),
    radial-gradient(1px 1px at 54% 88%, #fff, transparent);
}

button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ==========================================================
   Écran de verrouillage
   ========================================================== */

.lock-stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}

/* Boîte à la taille réelle (mise à l'échelle) du téléphone :
   c'est elle que flexbox centre, pas les 864 px d'origine. */
.phone-fit {
  position: relative;
  flex: none;
  width: calc(410px * var(--phone-scale));
  height: calc(864px * var(--phone-scale));
}

.phone {
  position: absolute;
  top: 0;
  left: 0;
  width: 410px;
  height: 864px;
  padding: 10px;
  border-radius: 68px;
  background: linear-gradient(145deg, #4a4a4f, #1c1c1f 40%, #3a3a3e 70%, #18181a);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.18),
    inset 0 0 0 7px #0a0a0b,
    0 40px 90px rgba(0, 0, 0, 0.6);
  transform: scale(var(--phone-scale));
  transform-origin: 0 0;
}

/* Boutons latéraux */
.phone::before,
.phone::after {
  content: "";
  position: absolute;
  width: 4px;
  border-radius: 2px;
  background: #2c2c30;
}
.phone::before { left: -3px; top: 170px; height: 64px; box-shadow: 0 84px 0 #2c2c30; }
.phone::after  { right: -3px; top: 220px; height: 100px; }

.phone-screen {
  position: relative;
  width: 390px;
  height: 844px;
  border-radius: 56px;
  overflow: hidden;
  /* Safari ne découpe pas les coins arrondis sous un parent mis à l'échelle (flou des touches) */
  isolation: isolate;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  background: #000;
  color: #fff;
  font-family: var(--sans);
  user-select: none;
  -webkit-user-select: none;
}

.wallpaper {
  position: absolute;
  inset: -60px;
  background:
    radial-gradient(circle at 22% 18%, #ff9a8b 0, transparent 42%),
    radial-gradient(circle at 82% 34%, #a18cd1 0, transparent 46%),
    radial-gradient(circle at 46% 96%, #fbc2eb 0, transparent 50%),
    linear-gradient(165deg, #2b1055 0%, #5b4bb7 55%, #7597de 100%);
  filter: blur(34px) saturate(1.1);
}
.wallpaper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
}

.island {
  position: absolute;
  top: 11px;
  left: 50%;
  width: 126px;
  height: 37px;
  margin-left: -63px;
  border-radius: 20px;
  background: #000;
  z-index: 5;
}

.statusbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 30px 0 52px;
  z-index: 4;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.2px;
}
.sb-icons { display: flex; align-items: center; gap: 6px; }
.sb-icons svg { fill: currentColor; }

.passcode {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 64px;
  z-index: 2;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.45s ease;
}

.pc-lock { fill: #fff; opacity: 0.95; }

.pc-title {
  margin: 52px 0 0;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.2px;
}

.dots {
  display: flex;
  gap: 24px;
  margin-top: 20px;
  height: 14px;
}
.dots span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.3px solid #fff;
  transition: background-color 0.12s ease;
}
.dots span.is-on { background: #fff; }
.dots.is-shaking { animation: ios-shake 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
.dots.is-checking span { animation: dot-wait 0.7s ease-in-out infinite alternate; }

@keyframes dot-wait {
  to { opacity: 0.45; }
}

@keyframes ios-shake {
  0%   { transform: translateX(0); }
  12%  { transform: translateX(-16px); }
  25%  { transform: translateX(14px); }
  37%  { transform: translateX(-11px); }
  50%  { transform: translateX(9px); }
  62%  { transform: translateX(-6px); }
  75%  { transform: translateX(4px); }
  87%  { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 78px);
  grid-auto-rows: 78px;
  column-gap: 26px;
  row-gap: 16px;
  margin-top: 52px;
}

.key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 78px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.17);
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.45s ease;
  outline: none;
}
.key.is-pressed {
  background: rgba(255, 255, 255, 0.5);
  transition: none;
}
.key:focus-visible { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7); }
.k-num {
  font-size: 37px;
  font-weight: 300;
  line-height: 1;
  margin-top: -2px;
}
.k-let {
  margin-top: 1px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  line-height: 12px;
  padding-left: 2px;
}
.key-zero .k-num { margin-top: 0; }

.hint {
  width: 300px;
  min-height: 40px;
  margin: 30px 0 0;
  font-size: 15px;
  line-height: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.88);
  text-wrap: balance;
  transition: opacity 0.3s ease;
}
.hint.is-fading { opacity: 0; }

.pc-bottom {
  position: absolute;
  left: 36px;
  right: 36px;
  bottom: 44px;
  display: flex;
  justify-content: space-between;
  z-index: 3;
}
.pc-link {
  width: 110px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
}

.home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 136px;
  height: 5px;
  margin-left: -68px;
  border-radius: 3px;
  background: #fff;
  z-index: 3;
}

/* Alerte iOS */
.ios-alert-backdrop {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  animation: fade-in 0.2s ease;
}
.ios-alert {
  width: 270px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(37, 37, 39, 0.9);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
  text-align: center;
  animation: ios-alert-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.ios-alert-body { padding: 19px 16px 18px; }
.ios-alert h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: -0.4px;
}
.ios-alert p {
  margin: 3px 0 0;
  font-size: 13px;
  line-height: 18px;
  letter-spacing: -0.1px;
}
.ios-alert-actions {
  display: flex;
  border-top: 0.5px solid rgba(84, 84, 88, 0.65);
}
.ios-alert-actions button {
  flex: 1 1 0;
  min-width: 0;
  height: 44px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--ios-blue);
  font-size: 17px;
  letter-spacing: -0.4px;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}
.ios-alert-actions button + button { border-left: 0.5px solid rgba(84, 84, 88, 0.65); }
.ios-alert-actions button:active { background: rgba(255, 255, 255, 0.08); }
.ios-alert-actions .is-strong { font-weight: 600; }

@keyframes ios-alert-in {
  from { opacity: 0; transform: scale(1.18); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Déverrouillage */
.lock-stage.is-unlocking .passcode,
.lock-stage.is-unlocking .pc-bottom {
  transform: scale(1.12);
  opacity: 0;
}
.lock-stage.is-unlocking .pc-bottom { transition: opacity 0.3s ease; }
.lock-stage.is-leaving { opacity: 0; }

/* ==========================================================
   Site déverrouillé
   ========================================================== */

.app {
  position: fixed;
  inset: 0;
  animation: app-in 0.7s ease both;
}
@keyframes app-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* Bande du haut : le rond « A » d'Ayliz y loge, rien ne passe dessous. */
.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--top);
  padding: env(safe-area-inset-top) 20px 0;
  display: flex;
  align-items: center;
}
.brand {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--muted);
}

.scroller {
  position: absolute;
  top: var(--top);
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 20px calc(48px + env(safe-area-inset-bottom));
}

.title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 7vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.subtitle {
  margin: 10px 0 0;
  font-size: 17px;
  color: var(--muted);
}

.options {
  display: grid;
  gap: 14px;
  margin-top: 30px;
}
@media (min-width: 640px) {
  .options { grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 40px; }
}

.option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.05);
  transition: opacity 0.4s ease, filter 0.4s ease;
}
.option-main {
  background:
    radial-gradient(ellipse 90% 80% at 100% 0%, rgba(246, 231, 184, 0.14), transparent 70%),
    rgba(255, 255, 255, 0.06);
  border-color: rgba(246, 231, 184, 0.3);
}
.option h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 23px;
}
.option p {
  margin: 6px 0 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}
.option .btn { margin-top: auto; }
.option.is-off { opacity: 0.38; filter: grayscale(0.5); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s ease, background-color 0.2s ease, opacity 0.2s ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled,
.btn[aria-disabled="true"] { cursor: default; opacity: 0.55; transform: none; }
.btn-primary { background: var(--moon); color: var(--moon-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: rgba(255, 255, 255, 0.35); }
.btn-arrow { flex: none; transition: transform 0.2s ease; }
.btn:hover .btn-arrow { transform: translateX(3px); }

@media (max-width: 639px) {
  .option .btn { align-self: stretch; }
}

.choice-note {
  margin: 14px 4px 0;
  font-size: 14px;
  color: var(--muted);
}

.gift {
  margin-top: 26px;
  padding: 26px 22px;
  border-radius: 24px;
  text-align: center;
  background:
    radial-gradient(ellipse 70% 90% at 50% 0%, rgba(246, 231, 184, 0.2), transparent 70%),
    rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(246, 231, 184, 0.3);
  animation: app-in 0.6s ease both;
}
.gift h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 28px;
}
.gift p { margin: 8px 0 20px; color: var(--muted); }
.gift-actions { display: flex; justify-content: center; align-items: center; gap: 10px; }

/* ==========================================================
   Ayliz — boîte de dialogue (logique dans ayliz.js)
   ========================================================== */

.ayliz-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(8, 8, 22, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.ayliz-box {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 51;
  width: min(620px, calc(100% - 24px));
  padding: 0 20px 14px;
  border-radius: 28px;
  background: #fff;
  color: #1d1b2e;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, 24px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.1), visibility 0s linear 0.35s;
  outline: none;
}

.ayliz-open .ayliz-overlay,
.ayliz-open .ayliz-box {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.ayliz-open .ayliz-box { transform: translate(-50%, 0); }

.ayliz-head {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: -30px;
}
.ayliz-avatar {
  flex: none;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(20, 16, 60, 0.25);
}
.ayliz-avatar svg,
.ayliz-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ayliz-letter {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 26px;
}
.ayliz-name {
  padding-bottom: 6px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.ayliz-body {
  max-height: min(52vh, 420px);
  overflow-y: auto;
  margin-top: 10px;
  cursor: pointer;
}
.ayliz-text {
  margin: 0;
  min-height: 78px;
  font-size: 17px;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.ayliz-ghost { visibility: hidden; }
.ayliz-vert { color: var(--green); font-weight: 600; }

.ayliz-photo { margin: 2px 0 0; }
.ayliz-frame {
  display: flex;
  justify-content: center;
  border-radius: 18px;
  overflow: hidden;
  background: #f4f1fb;
}
.ayliz-frame img {
  display: block;
  max-width: 100%;
  max-height: min(42vh, 340px);
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.ayliz-frame img.is-loaded { opacity: 1; }
.ayliz-ph {
  display: grid;
  place-items: center;
  width: 100%;
  height: min(30vh, 200px);
  font-size: 64px;
  background: linear-gradient(160deg, #f7f4ff, #ebe5fb);
}
.ayliz-photo figcaption {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
}

.ayliz-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.ayliz-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.ayliz-prev {
  flex: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #efecf8;
  color: #1d1b2e;
  font-size: 18px;
  cursor: pointer;
  touch-action: manipulation;
}
.ayliz-prev:disabled { opacity: 0.35; cursor: default; }
.ayliz-skip {
  flex: none;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: #0077b3;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
.ayliz-skip:active { transform: scale(0.96); }
.ayliz-skip[hidden] { display: none; }
.ayliz-count {
  padding: 0 8px;
  font-size: 13px;
  color: #7a7690;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Barre au-dessus de la bulle, à droite (l'avatar occupe la gauche) */
.ayliz-top {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  display: flex;
  justify-content: flex-end;
}
.ayliz-goto {
  height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}
.ayliz-jump {
  width: 236px;
  padding: 12px;
  border-radius: 22px;
  background: #fff;
  color: #1d1b2e;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
}
.ayliz-jump-ecran {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  padding: 6px 0 10px;
  font-variant-numeric: tabular-nums;
}
.ayliz-jump-valeur { font-size: 30px; font-weight: 600; }
.ayliz-jump-valeur.is-vide { color: #b7b2c9; }
.ayliz-jump-total { font-size: 16px; color: #7a7690; }
.ayliz-jump-pave {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ayliz-jump-touche {
  height: 46px;
  border: 0;
  border-radius: 14px;
  background: #f1eef9;
  color: #1d1b2e;
  font-size: 20px;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
}
.ayliz-jump-touche:active { background: #ddd7ef; }
.ayliz-jump-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.ayliz-jump-annuler,
.ayliz-jump-go {
  height: 44px;
  border: 0;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
.ayliz-jump-annuler { background: #f1eef9; color: #1d1b2e; }
.ayliz-jump-go { background: #1d1b2e; color: #fff; }
.ayliz-jump-go:disabled { opacity: 0.35; cursor: default; }
.ayliz-next {
  flex: none;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #1d1b2e;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s ease;
}
.ayliz-next:active { transform: scale(0.96); }

/* Petit rond « A » pour relancer la conversation */
.ayliz-relaunch {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: 16px;
  z-index: 40;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--moon-ink);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 44px;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 0 0 4px rgba(246, 231, 184, 0.25), 0 8px 22px rgba(0, 0, 0, 0.35);
  animation: fade-in 0.4s ease;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .app, .gift, .ayliz-relaunch { animation: none; }
}

/* ==========================================================
   Téléphone : écran de verrouillage seul, sans maquette
   ========================================================== */
.verrou-plein .lock-stage { overflow: hidden; }
.verrou-plein .lock-stage::before {
  content: "";
  position: absolute;
  inset: -60px;
  background:
    radial-gradient(circle at 22% 18%, #ff9a8b 0, transparent 42%),
    radial-gradient(circle at 82% 34%, #a18cd1 0, transparent 46%),
    radial-gradient(circle at 46% 96%, #fbc2eb 0, transparent 50%),
    linear-gradient(165deg, #2b1055 0%, #5b4bb7 55%, #7597de 100%);
  filter: blur(34px) saturate(1.1);
}
.verrou-plein .lock-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
}
.verrou-plein .phone-fit {
  z-index: 1;
  width: calc(390px * var(--phone-scale));
  height: calc(740px * var(--phone-scale));
}
.verrou-plein .phone {
  width: 390px;
  height: 740px;
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.verrou-plein .phone::before,
.verrou-plein .phone::after,
.verrou-plein .wallpaper,
.verrou-plein .island,
.verrou-plein .statusbar,
.verrou-plein .home-indicator { display: none; }
.verrou-plein .phone-screen {
  width: 390px;
  height: 740px;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}
.verrou-plein .passcode { padding-top: 20px; }
.verrou-plein .ios-alert-backdrop { background: transparent; }

/* ==========================================================
   Écran de choix : bandeau noir, zone bleue (essentiel),
   zone rose (tout lire), séparées par une diagonale
   ========================================================== */
.app:has(.choix) { background: #000; }
.choix {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.choix-tete {
  padding: 4px 24px 22px;
  background: #000;
}
.choix-zones {
  position: relative;
  flex: 1;
  min-height: 470px;
  background: #000; /* visible dans la fente diagonale */
}
.zone {
  position: absolute;
  inset: 0;
  color: #fff;
  transition: filter 0.4s ease;
}
.zone-bleu {
  background: linear-gradient(160deg, #19b4f5 0%, #0091d6 100%);
  clip-path: polygon(0 0, 100% 0, 100% 46%, 0 56%);
}
.zone-rose {
  background: linear-gradient(160deg, #ec4cf0 0%, #c81fd6 100%);
  clip-path: polygon(0 calc(56% + 6px), 100% calc(46% + 6px), 100% 100%, 0 100%);
}
.zone-contenu {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  text-align: center;
}
.zone-bleu .zone-contenu { top: 0; height: 46%; }
.zone-rose .zone-contenu { top: calc(56% + 6px); bottom: 0; }
.zone-choix,
.zone .gift { width: 100%; max-width: 440px; }
.zone h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
}
.zone p {
  margin: 6px 0 16px;
  font-size: 15px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.9);
}
.btn-zone {
  background: #fff;
  min-width: 180px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}
.zone-bleu .btn-zone { color: #0077b3; }
.zone-rose .btn-zone { color: #a3109f; }
.btn-zone.btn-rond { width: 48px; min-width: 0; padding: 0; flex: none; }
.zone.is-off { filter: grayscale(0.85) brightness(0.55); }
.zone .choice-note { margin: 12px 0 0; font-size: 13px; color: #fff; }
.zone .gift {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
.zone .gift h2 { font-size: 28px; }

/* Bouton Archive, posé au milieu de la fente diagonale */
.btn-archive {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: calc(51% + 3px);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 92px;
  height: 92px;
  border: 4px solid #000;
  border-radius: 50%;
  background: var(--moon);
  color: var(--moon-ink);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease;
}
.btn-archive[hidden] { display: none; }
.btn-archive:active { transform: translate(-50%, -50%) scale(0.95); }

/* Ordinateur : zones côte à côte (bleu à gauche, rose à droite) */
@media (min-width: 768px) {
  .zone-bleu { clip-path: polygon(0 0, 49% 0, 44% 100%, 0 100%); }
  .zone-rose { clip-path: polygon(calc(49% + 6px) 0, 100% 0, 100% 100%, calc(44% + 6px) 100%); }
  .zone-bleu .zone-contenu { top: 0; bottom: 0; height: auto; left: 0; right: 54%; }
  .zone-rose .zone-contenu { top: 0; bottom: 0; left: 52%; right: 0; }
  .btn-archive { left: calc(46.5% + 3px); top: 50%; width: 104px; height: 104px; }
}

/* ==========================================================
   Messagerie (codes de Zouzou et de Mohamed)
   ========================================================== */
.chat {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse 120% 60% at 50% 0%, #2a2560, var(--night) 70%);
  color: var(--ink);
  font-family: var(--sans);
}
.chat[hidden] { display: none; }
.chat-tete {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(14, 13, 34, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.chat-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--moon);
  color: var(--moon-ink);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}
.chat-qui { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-qui strong { font-size: 16px; font-weight: 600; }
.chat-statut { min-height: 16px; font-size: 12px; color: var(--muted); }
.chat-statut.is-ecrit { color: var(--moon); }
.chat-quitter {
  flex: none;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.chat-liste {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}
.chat-vide, .chat-jour, .chat-supprime {
  align-self: center;
  margin: 14px 0 10px;
  font-size: 12px;
  color: var(--muted);
}
.chat-jour { text-transform: capitalize; }
.chat-supprime { font-style: italic; margin: 8px 0; }
.chat-bulle {
  position: relative;
  max-width: 78%;
  padding: 8px 12px 6px;
  border-radius: 18px;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.chat-bulle p { margin: 0; }
.chat-bulle.is-colle { margin-top: 2px; }
.chat-bulle.is-espace { margin-top: 14px; }
.chat-bulle.is-moi.is-colle { border-top-right-radius: 6px; }
.chat-bulle.is-autre.is-colle { border-top-left-radius: 6px; }
.chat-bulle.is-moi { align-self: flex-end; background: var(--ios-blue); color: #fff; border-bottom-right-radius: 6px; cursor: pointer; }
.chat-bulle.is-autre { align-self: flex-start; background: #2b2850; border-bottom-left-radius: 6px; cursor: pointer; }
.chat-heure { display: block; margin-top: 2px; font-size: 10px; opacity: 0.65; text-align: right; }
.chat-vu { align-self: flex-end; margin: 3px 4px 2px; font-size: 11px; color: var(--muted); }
/* Menu d'une bulle : émojis, Oui / Non, Supprimer */
.chat-menu {
  position: absolute;
  top: calc(100% + 6px);
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: max-content;
  cursor: default;
}
.chat-bulle.is-moi .chat-menu { right: 0; }
.chat-bulle.is-autre .chat-menu { left: 0; }
.chat-bulle.a-reaction .chat-menu { top: calc(100% + 18px); }
.chat-emojis {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 4px;
  border-radius: 999px;
  background: #2b2850;
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.chat-emojis button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.chat-emojis button.is-choisi { background: rgba(255, 255, 255, 0.2); }
.chat-emojis .chat-emoji-plus { color: var(--muted); font: 400 24px var(--sans); background: rgba(255, 255, 255, 0.08); }
.chat-emoji-champ {
  width: 230px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font: 16px var(--sans);
  outline: none;
}
.chat-actions { display: flex; gap: 6px; }
.chat-actions button { flex: 1; }
.chat-modif {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #2b2850;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.chat-suppr {
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: #ff453a;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
/* Bandeau au-dessus du champ pendant qu'on modifie un message */
.chat-edition {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 16px 0;
  font-size: 13px;
  color: var(--muted);
}
.chat-edition[hidden] { display: none; }
.chat-edition button { background: none; border: 0; padding: 0; color: var(--ios-blue); font: inherit; font-weight: 600; cursor: pointer; }
.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}
.chat-form textarea {
  flex: 1;
  min-height: 40px;
  max-height: 140px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
  resize: none;
  outline: none;
}
.chat-form textarea:focus { border-color: rgba(255, 255, 255, 0.3); }
.chat-envoyer {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--ios-blue);
  color: #fff;
  cursor: pointer;
}

/* Menu de l'archive : un bouton par ancien fil */
.archive-menu { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 7, 20, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.archive-menu[hidden] { display: none; }
.archive-panneau { width: min(360px, 100%); background: var(--night-2); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.archive-tete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.archive-tete h2 { margin: 0; font: 600 1.25rem var(--serif); }
.archive-fermer { background: none; border: 0; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: 6px; }
.archive-liste { display: flex; flex-direction: column; gap: 8px; }
.archive-fil { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); color: var(--ink); font: 500 1rem var(--sans); text-align: left; cursor: pointer; }
.archive-fil:hover, .archive-fil:focus-visible { background: rgba(255, 255, 255, 0.12); }
.archive-fil small { color: var(--muted); font-size: 0.75rem; text-align: right; }

/* Notifications des messages de Mohamed (interface 2922) */
.notifs { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 60; width: min(420px, calc(100% - 32px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.notif { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 12px 14px; border: 0; border-radius: 18px; background: rgba(40, 38, 70, 0.82); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); color: var(--ink); text-align: left; font: 400 0.92rem/1.35 var(--sans); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); cursor: pointer; animation: notif-entre 0.35s ease-out; transition: opacity 0.3s, transform 0.3s; }
.notif.is-partie { opacity: 0; transform: translateY(-12px); }
.notif-icone { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--ios-blue); color: #fff; font-weight: 700; }
.notif-corps { flex: 1; min-width: 0; }
.notif-tete { display: flex; justify-content: space-between; gap: 8px; }
.notif-tete small { color: var(--muted); font-size: 0.75rem; white-space: nowrap; }
.notif-texte { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.notif.is-ouverte .notif-texte { display: block; max-height: 50vh; overflow-y: auto; }
@keyframes notif-entre { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }

/* 👀 : l'autre est sur la conversation */
.chat-yeux { margin-left: 6px; font-size: 15px; animation: yeux 0.3s ease-out; }
.chat-yeux[hidden] { display: none; }
@keyframes yeux { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
.chat-ligne { display: flex; align-items: center; }

/* Réactions sous une bulle : Oui / Non de Zouzou, émojis des deux */
.chat-bulle.a-reaction { margin-bottom: 14px; }
.chat-reactions { position: absolute; bottom: -12px; display: flex; gap: 4px; }
.chat-bulle.is-moi .chat-reactions { right: 12px; }
.chat-bulle.is-autre .chat-reactions { left: 12px; }
.chat-reaction { padding: 2px 9px; border-radius: 999px; font: 600 11px var(--sans); color: #fff; border: 2px solid var(--night); white-space: nowrap; }
.chat-reaction.is-emoji { padding: 1px 7px; background: #2b2850; font-size: 13px; }
.chat-reaction.is-oui { background: var(--green); }
.chat-reaction.is-non { background: #d64545; }
.chat-reagir { display: flex; gap: 6px; }
.chat-reagir button { flex: 1; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: #2b2850; color: var(--ink); font: 600 13px var(--sans); cursor: pointer; }
.chat-reagir button.is-oui.is-choisi { background: var(--green); border-color: var(--green); }
.chat-reagir button.is-non.is-choisi { background: #d64545; border-color: #d64545; }

/* Restaurer un message qu'on a supprimé */
.chat-restaurer { background: none; border: 0; padding: 0; color: var(--ios-blue); font: inherit; font-weight: 600; cursor: pointer; }
.chat-restaurer:disabled { opacity: 0.5; }

/* Images dans la discussion */
.chat-photo { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--muted); cursor: pointer; }
.chat-photo:hover { color: var(--ink); }
.chat-photo.is-envoi { opacity: 0.4; pointer-events: none; animation: envoi 1s ease-in-out infinite alternate; }
@keyframes envoi { to { opacity: 0.9; } }
.chat-bulle.is-image { padding: 4px; }
.chat-bulle.is-image .chat-heure { padding: 0 6px 2px; }
.chat-image { display: block; width: min(240px, 60vw); min-height: 120px; max-height: 320px; object-fit: cover; border-radius: 14px; background: rgba(255, 255, 255, 0.06); cursor: zoom-in; }
.chat-visionneuse { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.88); cursor: zoom-out; }
.chat-visionneuse img { max-width: 100%; max-height: 100%; border-radius: 10px; }
.chat-agrandir { display: block; width: 100%; margin-top: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.08); color: var(--ink); font: 600 13px var(--sans); cursor: pointer; }
