/* ═══════════════════════════════════════════════════════════════
   bereal.css — Interface BeReal JuMaRo
   Full-screen, immersive, graphique
   ═══════════════════════════════════════════════════════════════ */

/* ── Overlay plein écran ────────────────────────────── */
.br-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 2000;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
}
.br-overlay.open {
  display: flex;
}

/* ── Header ─────────────────────────────────────────── */
.br-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1rem;
  padding-top: calc(.85rem + env(safe-area-inset-top, 0px));
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  flex-shrink: 0;
  z-index: 10;
}

.br-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s;
}
.br-close:hover { background: rgba(255,255,255,.25); }
.br-close svg { width: 16px; height: 16px; stroke: #fff; }

.br-title {
  font: 700 1rem/1 'DM Sans', sans-serif;
  color: #fff;
  letter-spacing: -.01em;
}

/* ── Zone caméra ────────────────────────────────────── */
.br-stage {
  flex: 1;
  position: relative;
  background: #111;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

/* ── Vidéos ─────────────────────────────────────────── */
.br-video {
  position: absolute;
  object-fit: cover;
}

/* Caméra principale — plein cadre */
.br-video--main {
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
}

/* Vignette caméra avant — coin haut gauche */
.br-video--inset {
  top: 14px; left: 14px;
  width: 28%;
  aspect-ratio: 3/4;
  border-radius: 14px;
  border: 3px solid #fff;
  z-index: 3;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
  object-fit: cover;
  cursor: pointer;
  transition: transform .15s;
}
.br-video--inset:active { transform: scale(.96); }

/* ── Canvas résultat ────────────────────────────────── */
.br-canvas {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  z-index: 2;
  background: #000;
}

/* ── Badge étape ─────────────────────────────────────── */
.br-step-badge {
  display: none;
  position: absolute;
  top: .8rem; right: .8rem;
  background: rgba(0,0,0,.65);
  color: #fff;
  font: 600 .72rem/1 'DM Sans', sans-serif;
  padding: .35rem .75rem;
  border-radius: 20px;
  z-index: 10;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  letter-spacing: .02em;
}

/* ── Bouton déclencheur ─────────────────────────────── */
.br-shutter-wrap {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.br-shutter {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: transparent;
  border: 4px solid rgba(255,255,255,.9);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s, border-color .12s;
}
.br-shutter:hover  { transform: scale(1.06); }
.br-shutter:active { transform: scale(.93); }

.br-shutter-inner {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: #fff;
  transition: transform .12s, background .12s;
}
.br-shutter:active .br-shutter-inner {
  transform: scale(.88);
  background: #e0e0e0;
}

/* ── Bouton swap ────────────────────────────────────── */
.br-swap {
  position: absolute;
  bottom: 2.2rem; right: 1.5rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  border: 1.5px solid rgba(255,255,255,.3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background .15s;
}
.br-swap:hover  { background: rgba(0,0,0,.75); }
.br-swap svg { width: 18px; height: 18px; stroke: #fff; }

/* ── Flash ──────────────────────────────────────────── */
.br-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity .05s;
}
.br-flash.active {
  opacity: .85;
  transition: opacity .18s ease-out;
}

/* ── Footer (commentaire + actions) ─────────────────── */
.br-footer {
  background: #0b1220;
  padding: .85rem 1rem;
  padding-bottom: calc(.85rem + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.br-textarea {
  width: 100%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px;
  color: #fff;
  font: 400 .88rem/1.5 'DM Sans', sans-serif;
  padding: .65rem .9rem;
  resize: none;
  outline: none;
  transition: border-color .15s;
}
.br-textarea::placeholder { color: rgba(255,255,255,.35); }
.br-textarea:focus { border-color: rgba(255,255,255,.4); }

/* ── Actions ────────────────────────────────────────── */
.br-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
  justify-content: flex-end;
}

.br-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1rem;
  border-radius: 20px;
  font: 600 .8rem/1 'DM Sans', sans-serif;
  cursor: pointer;
  border: none;
  -webkit-tap-highlight-color: transparent;
  transition: all .15s;
  white-space: nowrap;
}

.br-btn--ghost {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.8);
  border: 1px solid rgba(255,255,255,.15);
}
.br-btn--ghost:hover {
  background: rgba(255,255,255,.18);
  color: #fff;
}
.br-btn--ghost svg {
  width: 14px; height: 14px; stroke: currentColor;
}

.br-btn--primary {
  background: #0f5132;
  color: #fff;
  border: none;
  box-shadow: 0 2px 10px rgba(15,81,50,.4);
}
.br-btn--primary:hover { background: #0d4429; }
.br-btn--primary:disabled {
  opacity: .6; cursor: not-allowed;
}

/* ── Message ─────────────────────────────────────────── */
.br-msg {
  position: absolute;
  bottom: 5.5rem; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.75);
  color: #fff;
  font: 400 .78rem/1.4 'DM Sans', sans-serif;
  padding: .5rem 1rem;
  border-radius: 20px;
  text-align: center;
  white-space: nowrap;
  max-width: 90vw;
  white-space: pre-wrap;
  z-index: 15;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
}
.br-msg:empty { display: none; }

/* ── Rendu de la photo BeReal dans le fil ────────────── */
.br-post-img {
  width: 100%;
  border-radius: 14px;
  display: block;
  object-fit: cover;
  aspect-ratio: 16/9;
  cursor: pointer;
  transition: transform .2s;
}
.br-post-img:hover { transform: scale(1.01); }

.br-post-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}

.br-post-badge {
  position: absolute;
  top: .6rem; left: .6rem;
  background: rgba(0,0,0,.6);
  color: #fff;
  font: 700 .6rem/1 'DM Sans', sans-serif;
  padding: .25rem .55rem;
  border-radius: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 720px) {
  .br-stage {
    /* Plein écran sur mobile */
    height: calc(100dvh - 52px - 130px);
  }
}

@media (min-width: 721px) {
  .br-overlay {
    /* Centré sur desktop */
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.85);
  }
  .br-overlay > * {
    width: 100%;
    max-width: 480px;
  }
  .br-stage {
    height: 520px;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
  }
  .br-header {
    border-radius: 16px 16px 0 0;
  }
  .br-footer {
    border-radius: 0 0 16px 16px;
  }
}

/* ── Bouton story dans le choix de destination ──────── */
.br-btn--story {
  background: rgba(245,158,11,.15);
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,.3);
  border-radius: 20px;
  padding: .55rem 1rem;
  font: 600 .8rem/1 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.br-btn--story:hover { background: rgba(245,158,11,.25); }
.br-btn--story:disabled { opacity: .5; cursor: not-allowed; }

/* ── Badge BeReal sur les bulles du carrousel ────────── */
.story-bubble--bereal .story-bubble__ring {
  border-color: #f59e0b !important;
  background: linear-gradient(135deg, #f59e0b, #ef4444) !important;
}
.story-bubble__badge {
  position: absolute;
  bottom: 22px;
  right: 0;
  font-size: .7rem;
  line-height: 1;
}
.story-bubble {
  position: relative;
}
