:root {
  --bg: #f7f1e6;
  --panel: rgba(255,255,255,0.96);
  --ink: #2a1f0f;
  --muted: #6f6656;
  --gold: #e2b55c;
  --gold-deep: #c0872c;
  --accent: #ff9a2f;
  --danger: #c94343;
  --radius: 18px;
  --shadow: 0 18px 40px rgba(0,0,0,.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body{
  background: transparent;
  color: var(--ink);
  font-family: "Segoe UI", Roboto, system-ui, sans-serif;
  min-height: 100vh;

  display:flex;
  flex-direction:column;
  align-items:center;
}

/* 🎥 VIDEO BACKGROUND */
.bg-video{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -3;
  pointer-events: none;
  filter: saturate(1.05) contrast(1.08);
}

.bg-overlay{
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;

  /* couche lisibilité (adapte si tu veux plus/moins visible) */
  background:
    radial-gradient(1100px 650px at 50% 0%,
      rgba(255,255,255,0.10),
      rgba(247,241,230,0.45) 60%),
    linear-gradient(to bottom,
      rgba(247,241,230,0.12),
      rgba(247,241,230,0.58));
}

/* ============================================================
   HEADER
   ============================================================ */
header{
  width: 100%;
  position: fixed;         /* ✅ en bas */
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  z-index: 50;

  background: linear-gradient(
    180deg,
    rgba(255,255,255,.88),
    rgba(247,241,230,.92)
  );

  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(190,150,70,.35);
  border-bottom: none;
  box-shadow: 0 -18px 40px rgba(0,0,0,.18);

  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}


header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: .6px;

  background: linear-gradient(
    180deg,
    #fff4cf,
    #f0c875,
    #d4a44c,
    #a97623
  );
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 820px;
  width: 100%;
}

.toolbar input,
.toolbar select {
  background: #fff;
  border: 1px solid #d8c8a2;
  color: var(--ink);

  padding: 12px 16px;
  border-radius: 999px;
  font-size: .95rem;
  outline: none;

  box-shadow: inset 0 1px 0 #fff;
}

/* Bouton retour */
.btn-back {
  background: linear-gradient(135deg,#ffe4aa,#ffc763);
  color: #5a3a05;
  font-weight: 800;

  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;

  border: 1px solid #d1a14b;
  box-shadow: 0 6px 16px rgba(0,0,0,.15);
}

.btn-back:hover {
  filter: brightness(1.05);
}

/* ============================================================
   LISTE CLOUDS
   ============================================================ */
main {
  width: 100%;
  max-width: 1200px;
  padding: 26px 16px 170px;
  flex: 1;
}

.grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(300px,1fr));
}

/* ---------- CARTE CLOUD ---------- */
.card {
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid rgba(198,158,73,.45);

  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;

  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;

  transition: transform .18s ease, box-shadow .18s ease;
}

/* barre lumineuse */
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,transparent,#f4d06f,#ffb84d,#f4d06f,transparent);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 52px rgba(0,0,0,.32);
}

/* ---------- Header carte ---------- */
.top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: linear-gradient(145deg,#fff,#f0e7d6);

  border: 1px solid rgba(195,155,70,.45);
  object-fit: cover;

  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.8),
    0 6px 16px rgba(0,0,0,.2);
}

.name {
  font-weight: 800;
  font-size: 1.1rem;
}

.meta {
  font-size: .85rem;
  color: var(--muted);
}

/* ---------- Description ---------- */
.desc {
  font-size: .95rem;
  line-height: 1.5;
  color: #3e3527;
}

/* ---------- Badges ---------- */
.badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  font-size: .75rem;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid;
}

.badge.public {
  background: rgba(90,170,120,.15);
  border-color: #4ca360;
  color: #256b3a;
}

.badge.private {
  background: rgba(200,70,70,.15);
  border-color: #c94343;
  color: #8b1f1f;
}

.badge.personal {
  background: rgba(160,150,90,.18);
  border-color: var(--gold);
  color: #6b520d;
}

/* ---------- Actions ---------- */
.actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
  flex-wrap: wrap;
}

.btn {
  flex: 1;
  text-align: center;

  padding: 11px 14px;
  border-radius: 999px;

  background: #fff;
  border: 1px solid #d4bd8b;

  color: var(--ink);
  font-weight: 800;
  text-decoration: none;

  transition: all .15s ease;
}

.btn:hover {
  border-color: var(--gold);
  box-shadow: 0 6px 14px rgba(0,0,0,.18);
}

.btn.edit {
  background: linear-gradient(135deg,#ffca70,#ff932e);
  color: #3b2200;
  border-color: var(--accent);
}

/* ---------- Empty ---------- */
#empty {
  text-align: center;
  margin-top: 40px;
  color: var(--muted);
  font-size: 1.05rem;
}

/* ============================================================
   MODAL
   ============================================================ */
#pwModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

#pwCard {
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(198,158,73,.45);

  width: min(420px,95vw);
  padding: 18px;

  box-shadow: 0 18px 40px rgba(0,0,0,.4);
}

#pwCard h3 {
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.pw-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.pw-row input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid #d4bd8b;
}

.pw-row button {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #d4bd8b;
  background: linear-gradient(135deg,#ffe4aa,#ffc763);
  font-weight: 700;
  cursor: pointer;
}

#pwError {
  color: #b21f1f;
  margin-top: 10px;
  min-height: 1.2em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 520px) {
  .grid { gap: 16px; }
  header h1 { font-size: 1.3rem; }
}

@media (max-width: 700px){
  header{
    padding: 8px 10px 10px;
    gap: 6px;
  }

  header h1{
    font-size: 1.05rem;
    line-height: 1.1;
  }

  .btn-back{
    padding: 8px 12px;
    font-size: .85rem;
  }

  .toolbar{
    gap: 8px;
  }

  .toolbar input,
  .toolbar select{
    padding: 9px 12px;
    font-size: .88rem;
  }

  /* Le texte "connecté" devient plus discret */
  header > div[style*="Connecté"]{
    font-size: .75rem !important;
    opacity: .85;
  }

  main{
    padding-bottom: 200px; /* un peu plus sur mobile */
  }
}

.bg-video{
  content-visibility:auto;
}