﻿/* Pepite · Mode AR — overrides spécifiques (hérite tiktok.css pour la base). */

.ar-topbar .brand-flag {
  filter: drop-shadow(0 0 8px rgba(108, 92, 255, 0.55));
}

/* Body padding réduit pour que le panel + toggles tiennent dans le viewport */
body {
  padding-top: 12px;
  padding-bottom: 18px;
  gap: 12px;
}

/* Panel plus compact pour que les toggles rentrent sans scroll */
.panel {
  padding: 10px;
  gap: 6px;
}

.panel .status {
  font-size: 13px;
  line-height: 1.3;
}

/* Hint masqué : libère l'espace pour que les toggles tiennent dans le viewport */
.panel .hint {
  display: none;
}

/* Privacy notice — réassurance VISIBLE : rien n'est enregistré, tout reste
 * sur l'appareil. Volontairement plus présent que .hint (qui est masqué) car
 * des créateurs s'inquiètent que le filtre garde leur visage. */
.privacy-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 8px auto 0;
  padding: 7px 12px;
  max-width: 360px;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
  text-align: center;
  color: #f5f0e6;
  background: rgba(108, 92, 255, 0.16);
  border: 1px solid rgba(108, 92, 255, 0.45);
  border-radius: var(--radius, 14px);
}
.privacy-notice-result {
  margin-top: 10px;
}

/* Playback video : même cadre que le canvas.
 * IMPORTANT : override pointer-events:none hérité de la règle partagée
 * #webcam,#playback dans tiktok.css (sinon les contrôles natifs sont bloqués). */
#playback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  background: #000;
  object-fit: cover;
  pointer-events: auto;
}

/* Gros bouton Enregistrer/Stop (Mode AR — user contrôle la durée). */
.btn-record-big {
  font-size: 22px;
  font-weight: 800;
  padding: 18px 36px;
  border-radius: 999px;
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #ff3b30 0%, #ff2d55 60%, #d70015 100%);
  box-shadow: 0 8px 24px rgba(255, 45, 85, 0.45), 0 0 0 4px rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.2s ease;
  letter-spacing: 0.5px;
}
.btn-record-big:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(255, 45, 85, 0.55), 0 0 0 4px rgba(255, 255, 255, 0.10); }
.btn-record-big:active { transform: translateY(1px); }
.btn-record-big[disabled] { opacity: 0.55; cursor: not-allowed; }
/* État "Stop" pendant l'enregistrement : on inverse en sombre + pulse rouge */
.btn-record-big.is-recording {
  background: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 100%);
  box-shadow: 0 0 0 4px rgba(255, 45, 85, 0.35), 0 0 30px rgba(255, 45, 85, 0.45);
  animation: rec-pulse 1.4s ease-in-out infinite;
}
@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 45, 85, 0.35), 0 0 30px rgba(255, 45, 85, 0.45); }
  50%      { box-shadow: 0 0 0 6px rgba(255, 45, 85, 0.55), 0 0 42px rgba(255, 45, 85, 0.70); }
}

/* ===== FX Toggles ===== */
.fx-toggles {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 8px 10px;
}
.fx-toggles-hint {
  margin: 0 0 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.50);
  text-align: center;
  line-height: 1.3;
}
.fx-toggles-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fx-toggles-grid[hidden] {
  display: none;
}
.fx-slider-master {
  margin-bottom: 4px;
}
.fx-toggle-detail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin: 4px 0;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.fx-toggle-detail:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.9);
}
.fx-toggle-detail-caret {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 10px;
}
.fx-toggle-detail[aria-expanded="true"] .fx-toggle-detail-caret {
  transform: rotate(180deg);
}
.fx-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.fx-slider-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  min-width: 105px;
}
.fx-slider-row input[type="range"] {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}
.fx-slider-row input[type="range"]:focus-visible {
  outline: 2px solid var(--accent, #ff3d8a);
  outline-offset: 3px;
}
.fx-slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent, #ff3d8a);
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(255, 61, 138, 0.5);
}
.fx-slider-row input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent, #ff3d8a);
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(255, 61, 138, 0.5);
}
.fx-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  user-select: none;
}
.fx-check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent, #ff3d8a);
  cursor: pointer;
}
.fx-check-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}
.fx-slider-val {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.50);
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* =======================================================
   Mode IFRAME EMBEDDED (overlay G1 sur l'accueil)
   Skin pure-typo cohérent avec feedback_overlays_typo_pure :
   - pas de fond noir, body transparent (cosmos parent visible)
   - pas de panel card / pill button : texte sur contexte
   - Bodoni italic pour actions, DM Sans normal pour labels FX
   - close X discret en haut-droite
   ======================================================= */

html.is-embedded,
html.is-embedded body {
  background: transparent !important;
  min-height: 0;
}

html.is-embedded body {
  padding: 0;
  gap: 0;
  display: block;
  /* Contours noirs pour lisibilité du texte sur cosmos parent */
  text-shadow:
    0 0 1px rgba(0, 0, 0, 0.95),
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 0 18px rgba(0, 0, 0, 0.4);
}

/* Header standalone caché en embed — le close X et le contexte parent suffisent */
html.is-embedded .topbar,
html.is-embedded .ar-topbar {
  display: none;
}

/* Close X — visible en haut-droite, halo sombre pour lisibilité sur cosmos */
.pep-ar-close {
  display: none;
}
html.is-embedded .pep-ar-close {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: clamp(0.6rem, 2vw, 1.1rem);
  right: clamp(0.6rem, 2vw, 1.1rem);
  z-index: 9999;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 0;
  background: rgba(10, 10, 18, 0.55);
  backdrop-filter: blur(8px) saturate(110%);
  -webkit-backdrop-filter: blur(8px) saturate(110%);
  color: #f5f0e6;
  font-family: 'Bodoni Moda', 'Times New Roman', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: 0;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 200ms, transform 200ms, background 200ms;
  padding: 0;
  text-shadow:
    0 0 1px rgba(0, 0, 0, 0.95),
    0 1px 2px rgba(0, 0, 0, 0.85);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
html.is-embedded .pep-ar-close:hover {
  opacity: 1;
  transform: scale(1.06);
  background: rgba(10, 10, 18, 0.75);
}
html.is-embedded .pep-ar-close:active {
  transform: scale(0.96);
}

/* Scène caméra — transparente, pas de box-shadow ni bg solide */
html.is-embedded .stage-wrap {
  padding: 0;
}
html.is-embedded .stage {
  background: transparent;
  box-shadow: none;
  width: min(360px, 86vw);
}
html.is-embedded #stage-canvas {
  background: transparent;
}

/* Panel info/actions — pure-typo, pas de carte */
html.is-embedded .panel {
  background: transparent !important;
  border: 0 !important;
  padding: 0.8rem 0.6rem 1.2rem !important;
  max-width: 480px;
  margin: 0 auto;
  gap: 0.9rem;
  font-family: 'Bodoni Moda', 'Times New Roman', serif;
  color: #f5f0e6;
}

html.is-embedded .status {
  font-family: 'Bodoni Moda', 'Times New Roman', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(0.92rem, 2vw, 1.05rem);
  color: #f5f0e6;
  opacity: 0.78;
  text-shadow: inherit;
  line-height: 1.45;
}
html.is-embedded .status a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* Actions — flex column, boutons texte pur Bodoni italic */
html.is-embedded .actions,
html.is-embedded .actions-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  grid-template-columns: none;
}

html.is-embedded .btn,
html.is-embedded .btn-primary,
html.is-embedded .btn-ghost,
html.is-embedded .btn-record-big,
html.is-embedded .btn-share-big {
  font-family: 'Bodoni Moda', 'Times New Roman', serif !important;
  font-style: italic;
  font-weight: 400 !important;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem) !important;
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: #f5f0e6 !important;
  cursor: pointer;
  padding: 0.3rem 0.6rem !important;
  letter-spacing: 0.01em;
  text-decoration: none;
  opacity: 0.86;
  transition: opacity 200ms, letter-spacing 220ms !important;
  text-shadow: inherit;
  box-shadow: none !important;
  animation: none !important;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto !important;
}
html.is-embedded .btn:hover,
html.is-embedded .btn-primary:hover,
html.is-embedded .btn-ghost:hover,
html.is-embedded .btn-record-big:hover,
html.is-embedded .btn-share-big:hover {
  opacity: 1;
  letter-spacing: 0.03em;
  transform: none;
  filter: none;
  box-shadow: none !important;
}
html.is-embedded .btn:disabled,
html.is-embedded .btn-primary:disabled,
html.is-embedded .btn-ghost:disabled,
html.is-embedded .btn-record-big:disabled,
html.is-embedded .btn-share-big:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
/* État "enregistrement" : icône clignote en texte, pas de bg rouge */
html.is-embedded .btn-record-big.is-recording {
  background: transparent !important;
  animation: pep-ar-rec-blink 1.4s ease-in-out infinite !important;
  box-shadow: none !important;
}
@keyframes pep-ar-rec-blink {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; letter-spacing: 0.04em; }
}
/* Btn-ghost (Télécharger / Refaire) plus discret */
html.is-embedded .btn-ghost {
  font-size: clamp(0.92rem, 2vw, 1.05rem) !important;
  opacity: 0.65;
}
html.is-embedded .btn-ghost:hover { opacity: 0.95; }

/* Privacy notice en embed — garde la pastille visible mais accordée au skin
 * Bodoni (pure-typo). Réassurance claire : rien n'est enregistré. */
html.is-embedded .privacy-notice {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #f5f0e6;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(245, 240, 230, 0.35);
}

/* Hint local — italique discret, on le réaffiche en embed */
html.is-embedded .panel .hint {
  display: block;
  font-family: 'Bodoni Moda', 'Times New Roman', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 0.82rem;
  color: #f5f0e6;
  opacity: 0.5;
  margin-top: 0.4rem;
  line-height: 1.4;
  text-shadow: inherit;
}

/* REC indicator — relogé en haut-gauche, italic discret */
html.is-embedded .rec-indicator {
  position: fixed;
  top: clamp(0.4rem, 1.6vw, 0.9rem);
  left: clamp(0.4rem, 1.6vw, 0.9rem);
  z-index: 999;
  background: transparent;
  border: 0;
  padding: 0.2rem 0.4rem;
  font-family: 'Bodoni Moda', 'Times New Roman', serif;
  font-style: italic;
  color: #f5f0e6;
  text-shadow: inherit;
}
html.is-embedded .rec-indicator .rec-dot {
  background: #ff3d8a;
  box-shadow: 0 0 8px rgba(255, 61, 138, 0.7);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pep-ar-rec-dot 1.2s ease-in-out infinite;
}
@keyframes pep-ar-rec-dot {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

/* FX toggles — DM Sans pour labels (texte normal), pas de Bodoni italic */
html.is-embedded .fx-toggles {
  background: transparent;
  border: 0;
  padding: 0.4rem 0;
  margin-top: 0.4rem;
  font-family: 'DM Sans', system-ui, sans-serif;
}
html.is-embedded .fx-toggles-hint {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.78rem;
  color: rgba(245, 240, 230, 0.55);
  text-shadow: inherit;
}
html.is-embedded .fx-slider-label,
html.is-embedded .fx-check-label {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  color: rgba(245, 240, 230, 0.88);
  text-shadow: inherit;
}
html.is-embedded .fx-slider-val {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 500;
  color: rgba(245, 240, 230, 0.55);
}
html.is-embedded .fx-toggle-detail {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  color: rgba(245, 240, 230, 0.7);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(245, 240, 230, 0.18);
  border-radius: 0;
  padding: 0.3rem 0.4rem;
  text-shadow: inherit;
}
html.is-embedded .fx-toggle-detail:hover {
  color: rgba(245, 240, 230, 0.95);
  border-bottom-color: rgba(245, 240, 230, 0.5);
}
html.is-embedded .fx-check-row {
  border-top-color: rgba(245, 240, 230, 0.1);
}
html.is-embedded .fx-slider-row input[type="range"] {
  background: rgba(245, 240, 230, 0.15);
}

/* Share modal — fond moins opaque en embed (cohérent overlay aesthetic) */
html.is-embedded .share-modal {
  background: rgba(5, 5, 10, 0.5);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
}

/* =======================================================
   Mode CAMERA-ONLY (iframe slim pour dimension-hybrid AR view)
   L'iframe ne contient que le rectangle caméra. Tout est piloté
   par le parent (g1-overlay) via clicks DOM programmatiques sur
   les boutons cachés + postMessage pour les state updates.
   ======================================================= */

html.is-camera-only,
html.is-camera-only body {
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

/* Masque TOUT sauf le main + canvas */
html.is-camera-only .topbar,
html.is-camera-only .ar-topbar,
html.is-camera-only .panel,
html.is-camera-only .pep-ar-close,
html.is-camera-only #pep-ar-close,
html.is-camera-only .share-modal,
html.is-camera-only .lang-toggle,
html.is-camera-only .feedback-floating-button,
html.is-camera-only .rec-indicator,
html.is-camera-only #status,
html.is-camera-only .fx-toggles,
html.is-camera-only .actions,
html.is-camera-only .actions-result,
html.is-camera-only .hint {
  display: none !important;
}

html.is-camera-only .stage-wrap {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
}

html.is-camera-only .stage {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  max-width: none !important;
}

html.is-camera-only #stage-canvas {
  width: 100% !important;
  height: 100% !important;
  background: transparent;
}

html.is-camera-only #playback {
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
}
