/* =========================================================================
   Studio rigolo (camera a filtres) et espace enfants.

   Le studio assume de sortir de l'habillage "Claire": plein ecran, fond noir,
   boutons ronds et couleurs vives. C'est un jouet, et il est pense pour des
   doigts d'enfants sur un telephone. Tout est prefixe .studio- pour ne rien
   toucher ailleurs. Le reste (salon, espace parents) reste sobre et suit le
   theme.
   ========================================================================= */

/* ---------- Bouton camera dans la barre de saisie ---------- */
.composer {
  grid-template-columns: 46px 46px minmax(0, 1fr) 104px;
}

.studio-btn {
  height: 46px;
  width: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease;
}

.studio-btn:hover {
  border-color: var(--green-primary);
  transform: scale(1.06) rotate(-6deg);
}

.salon-enfants-actif .studio-btn {
  background: linear-gradient(135deg, #fde68a, #f9a8d4 55%, #a5b4fc);
  border-color: transparent;
  animation: studio-appel 2.4s ease-in-out infinite;
}

@keyframes studio-appel {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08) rotate(-5deg); }
}

/* ---------- Les videos du studio, dans le fil ---------- */
.attachment video {
  display: block;
  width: min(300px, 100%);
  max-height: 420px;
  background: #000;
}

/* ---------- Le salon dans la liste ---------- */
.conversation-row.salon-enfants .conversation-icon {
  display: grid;
  place-items: center;
  font-size: 20px;
  background: linear-gradient(135deg, #fde68a, #f9a8d4 55%, #a5b4fc);
}

/* ---------- Inscription: la case 15 ans ---------- */
.age-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.4;
}

.age-check input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  flex: none;
}

.age-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---------- Espace parents ---------- */
.parents-btn {
  margin-top: 8px;
}

.parents-card {
  width: min(520px, 100%);
}

.parents-liste {
  display: grid;
  gap: 8px;
  max-height: 40vh;
  overflow: auto;
}

.parents-enfant {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
}

.parents-enfant-tete {
  display: flex;
  align-items: center;
  gap: 10px;
}

.parents-enfant-tete small {
  color: var(--text-secondary);
}

.parents-enfant form {
  display: flex;
  gap: 8px;
}

.parents-enfant form input {
  flex: 1;
  min-width: 0;
}

.parents-form {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
}

.parents-form h3,
.parents-enfant h3 {
  margin: 0;
  font-size: 14px;
}

.parents-form .parents-ligne {
  display: flex;
  gap: 8px;
}

.parents-form .parents-ligne input {
  flex: 1;
  min-width: 0;
}

.parents-note {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ---------- Le studio, plein ecran ---------- */
body.studio-ouvert {
  overflow: hidden;
}

.studio {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: #000;
  color: #fff;
  font-family: "Manrope", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.studio[hidden] {
  display: none;
}

.studio-scene {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.studio-camera {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.studio-canvas,
.studio-resultat-img,
.studio-resultat-video {
  grid-area: 1 / 1;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 22px;
}

.studio-resultat-img,
.studio-resultat-video {
  z-index: 2;
  background: #000;
}

.studio-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

.studio-flash-on {
  animation: studio-flash 0.35s ease-out;
}

@keyframes studio-flash {
  from { opacity: 0.85; }
  to { opacity: 0; }
}

.studio-haut {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  background: linear-gradient(rgba(0, 0, 0, 0.45), transparent);
}

.studio-titre {
  font-size: 17px;
  font-weight: 800;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-rond {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 0.12s ease, background 0.15s ease;
}

.studio-rond:hover {
  background: rgba(255, 255, 255, 0.3);
}

.studio-rond:active {
  transform: scale(0.92);
}

.studio-rond-grand {
  width: 58px;
  height: 58px;
  font-size: 24px;
  gap: 0;
  align-content: center;
}

.studio-rond-grand small {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.studio-garder {
  position: absolute;
  top: 70px;
  left: 50%;
  z-index: 3;
  transform: translateX(-50%);
  min-height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #facc15, #f97316);
  color: #1c1917;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.studio-garder[hidden],
.studio-resultat .studio-garder {
  display: none;
}

.studio-astuce,
.studio-toast,
.studio-erreur {
  position: absolute;
  left: 50%;
  z-index: 3;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 10px 16px;
  border-radius: 999px;
  transform: translateX(-50%);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
}

.studio-astuce {
  bottom: 16px;
  animation: studio-rebond 1.6s ease-in-out infinite;
}

.studio-toast {
  top: 76px;
  background: linear-gradient(135deg, #f472b6, #8b5cf6);
}

.studio-erreur {
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 18px;
  padding: 18px 22px;
}

.studio-astuce[hidden],
.studio-toast[hidden],
.studio-erreur[hidden] {
  display: none;
}

@keyframes studio-rebond {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-5px); }
}

/* ---------- Le bas: carrousel, declencheur ---------- */
.studio-bas {
  display: grid;
  gap: 10px;
  padding: 12px 0 max(14px, env(safe-area-inset-bottom));
  background: #000;
}

.studio-carrousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 16px 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.studio-carrousel::-webkit-scrollbar {
  display: none;
}

.studio-filtre {
  flex: none;
  width: 68px;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  scroll-snap-align: center;
}

.studio-filtre-icone {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 30px;
  background: rgba(255, 255, 255, 0.12);
  border: 3px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.studio-filtre.perso .studio-filtre-icone {
  background: rgba(139, 92, 246, 0.35);
}

.studio-filtre.actif .studio-filtre-icone {
  border-color: #facc15;
  transform: scale(1.1);
}

.studio-filtre-nom {
  max-width: 100%;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-commandes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
}

.studio-declencheur {
  --progression: 0deg;
  position: relative;
  width: 82px;
  height: 82px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: conic-gradient(#ef4444 var(--progression), rgba(255, 255, 255, 0.9) 0);
  cursor: pointer;
  touch-action: none;
}

.studio-declencheur span {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #000;
  transition: transform 0.15s ease, background 0.15s ease;
}

.studio-declencheur:active span {
  transform: scale(0.9);
}

.studio-enregistre .studio-declencheur span {
  background: #ef4444;
  transform: scale(0.72);
  border-radius: 18px;
}

.studio-aide {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

.studio-revue {
  display: none;
  justify-content: center;
  gap: 12px;
  padding: 0 16px;
}

.studio-resultat .studio-revue {
  display: flex;
}

.studio-resultat .studio-carrousel,
.studio-resultat .studio-commandes,
.studio-resultat .studio-aide,
.studio-resultat .studio-astuce {
  display: none;
}

.studio-bouton {
  min-height: 50px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #facc15, #f97316);
  color: #1c1917;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.studio-bouton:disabled {
  opacity: 0.6;
}

.studio-bouton-doux {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.studio-bouton-danger {
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
}

/* ---------- L'atelier: une feuille qui monte par-dessus le bas ---------- */
.studio-atelier {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  max-height: 58%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 24px 24px 0 0;
  background: rgba(24, 24, 27, 0.94);
  backdrop-filter: blur(14px);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
}

.studio-atelier[hidden] {
  display: none;
}

.studio-atelier-tete,
.studio-atelier-pied {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
}

.studio-atelier-pied {
  justify-content: flex-end;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

.studio-atelier-tete input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.studio-atelier-tete input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.studio-atelier-corps {
  overflow-y: auto;
  padding: 0 0 8px;
}

.studio-atelier-ligne h3 {
  margin: 10px 16px 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #facc15;
}

/* Les choix passent a la ligne au lieu de defiler de cote: a la souris, une
   rangee qui defile sans barre visible cachait tout ce qui depassait a droite. */
.studio-puces {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 16px 4px;
}

.studio-puces::-webkit-scrollbar {
  display: none;
}

.studio-puce {
  flex: none;
  min-width: 64px;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 8px 6px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 24px;
  line-height: 1.1;
  cursor: pointer;
}

.studio-puce small {
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.studio-puces-icones .studio-puce {
  min-width: 48px;
  padding: 8px;
}

.studio-puce.actif {
  border-color: #facc15;
  background: rgba(250, 204, 21, 0.2);
}

@media (min-width: 900px) {
  .studio-canvas,
  .studio-resultat-img,
  .studio-resultat-video {
    max-height: calc(100% - 24px);
  }

  .studio-atelier {
    left: auto;
    right: 24px;
    bottom: 24px;
    width: 420px;
    /* Laisse la barre du haut (fermer, changer de camera) accessible. */
    max-height: calc(100% - 96px);
    border-radius: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .studio-astuce,
  .salon-enfants-actif .studio-btn {
    animation: none;
  }
}

/* A la souris (ordinateur), le carrousel des filtres montre une barre de
   defilement fine; la molette le fait aussi defiler (cf. fun-filters.js). */
@media (hover: hover) and (pointer: fine) {
  .studio-carrousel {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
  }

  .studio-carrousel::-webkit-scrollbar {
    display: block;
    height: 6px;
  }

  .studio-carrousel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.35);
    border-radius: 3px;
  }
}

/* ---------- Carrousel: les sections (Stars, Rigolos, Les miens) ---------- */
.studio-section {
  flex: none;
  align-self: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding: 4px 2px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.studio-section-stars {
  color: #facc15;
  border-left: 0;
}

.studio-filtre.star .studio-filtre-icone {
  background: radial-gradient(circle at 30% 25%, rgba(250, 204, 21, 0.45), rgba(249, 115, 22, 0.28) 60%, rgba(255, 255, 255, 0.08));
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.35);
}

/* ---------- Journal d'un enfant (espace parents) ---------- */
.journal-card {
  width: min(720px, 100%);
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.journal-filtres {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.journal-filtres .actif {
  border-color: var(--green-primary);
  color: var(--green-primary);
}

.journal-liste {
  overflow: auto;
  display: grid;
  gap: 8px;
  align-content: start;
}

.journal-ligne {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  font-size: 14px;
}

.journal-ligne p {
  margin: 0;
  white-space: pre-wrap;
}

.journal-de-lui {
  border-left-color: var(--green-primary);
}

.journal-efface {
  background: var(--danger-soft);
}

.journal-evenement {
  display: block;
  background: var(--panel-elevated);
}

.journal-quand {
  font-size: 11px;
  color: var(--text-secondary);
}

.journal-evenement .journal-quand {
  margin-right: 8px;
}

.journal-supprime {
  font-size: 12px;
  font-weight: 700;
  color: var(--danger);
}

.journal-image {
  max-width: 220px;
  max-height: 220px;
  display: block;
}

/* ---------- L'oeil des mots de passe, et le mot de passe oublie ---------- */
.champ-secret {
  position: relative;
  display: block;
}

.champ-secret input {
  width: 100%;
  padding-right: 44px;
}

.oeil {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.65;
}

.oeil:hover,
.oeil.actif {
  opacity: 1;
}

.lien-discret {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--green-primary);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.oubli-card {
  width: min(460px, 100%);
}

.oubli-question {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.oubli-card label,
.oubli-card select,
.oubli-card input {
  display: block;
  width: 100%;
}

.oubli-card select {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  font: inherit;
  color: var(--text);
}
