:root {
  --bg1: #2a0a1c;
  --bg2: #5a1235;
  --card: rgba(255, 255, 255, 0.08);
  --card-solid: #3a1228;
  --card-border: rgba(255, 255, 255, 0.16);
  --text: #fff4f7;
  --muted: #e0b3c3;
  --accent: #ff5c8a;
  --accent2: #ffb36b;
  --on-accent: #2a0a1c;
  --ok: #6be3a4;
  --bad: #ff8a8a;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background: radial-gradient(1200px 800px at 20% 0%, var(--bg2), var(--bg1)) fixed;
}
body.locked { overflow: hidden; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 5vw, 2.3rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

/* ---------- Décor ---------- */
#floaters { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.floater { position: absolute; bottom: -40px; opacity: 0; animation: floatUp linear infinite; }
@keyframes floatUp {
  0% { transform: translateY(0) rotate(0); opacity: 0; }
  10% { opacity: .4; }
  90% { opacity: .25; }
  100% { transform: translateY(-110vh) rotate(40deg); opacity: 0; }
}

/* ---------- Mise en page ---------- */
#app { position: relative; z-index: 1; max-width: 1040px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px 110px; }
.card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 20px; padding: clamp(16px, 4vw, 26px);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 18px 44px rgba(0, 0, 0, .18);
}
.scene { animation: sceneIn .5s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes sceneIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Boutons & champs ---------- */
.btn {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 999px; padding: .75rem 1.4rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--on-accent);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .25); transition: transform .15s, filter .15s; text-decoration: none; display: inline-flex; gap: .4rem; align-items: center; justify-content: center;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--card-border); box-shadow: none; }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); box-shadow: none; }
.btn.sm { padding: .45rem .95rem; font-size: .88rem; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; text-decoration: underline; padding: .4rem; }
.iconbtn {
  font: inherit; cursor: pointer; border: 1px solid var(--card-border); background: transparent; color: var(--text);
  border-radius: 12px; min-width: 38px; height: 38px; padding: 0 .6rem; display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
}
.iconbtn:hover { border-color: var(--accent); }

input[type='text'], input[type='password'], input[type='number'], input[type='url'], input[type='date'], input[type='search'], textarea, select {
  width: 100%; font: inherit; color: var(--text); background: rgba(0, 0, 0, .25); border: 1px solid var(--card-border);
  border-radius: 12px; padding: .7rem .9rem; outline: none; transition: border-color .2s, box-shadow .2s; color-scheme: dark;
}
select option { background: #3a1228; color: #fff; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
textarea { min-height: 90px; resize: vertical; }
.field { display: grid; gap: 6px; margin-bottom: 14px; align-content: start; }
.field > label, .lbl { font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.err { color: var(--bad); min-height: 1.4em; font-size: .9rem; }

/* ---------- Puces ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.chip {
  font: inherit; font-size: .85rem; cursor: pointer; color: var(--text); background: rgba(0, 0, 0, .2); border: 1px solid var(--card-border);
  border-radius: 999px; padding: .3rem .8rem; transition: background .15s, border-color .15s; white-space: nowrap;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed='true'] { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--on-accent); border-color: transparent; font-weight: 600; }
.tag { display: inline-flex; align-items: center; gap: .25rem; font-size: .78rem; padding: .15rem .6rem; border-radius: 999px; background: rgba(255, 255, 255, .1); white-space: nowrap; }
.tag.price { background: color-mix(in srgb, var(--accent2) 28%, transparent); }

/* ---------- En-tête ---------- */
.header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: clamp(1.15rem, 4.2vw, 1.6rem); line-height: 1.15; }
.brand small { display: block; font-family: var(--sans); font-weight: 500; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent2); }
.userbtn { display: inline-flex; align-items: center; gap: .5rem; font: inherit; color: var(--text); cursor: pointer; border-radius: 999px; padding: .3rem .9rem .3rem .35rem; background: var(--card); border: 1px solid var(--card-border); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: rgba(255, 255, 255, .14); font-size: 1.1rem; flex: none; }
.avatar.sm { width: 22px; height: 22px; font-size: .85rem; }

.invite { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 14px; padding: 12px 16px; }
.invite code { background: rgba(0, 0, 0, .3); padding: .2rem .6rem; border-radius: 8px; letter-spacing: .15em; font-weight: 600; }

/* ---------- Onglets & barre d'actions ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; }
.tab { font: inherit; font-weight: 500; white-space: nowrap; cursor: pointer; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 999px; padding: .5rem 1rem; }
.tab[aria-selected='true'] { color: var(--text); background: var(--card); border-color: var(--card-border); }
.tab .n { opacity: .7; font-size: .8rem; margin-left: .25rem; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .search { flex: 1 1 200px; min-width: 0; }
.toolbar select { width: auto; }

.filters { margin-bottom: 14px; padding: 14px 16px; display: grid; gap: 12px; }
.filters .grp { display: grid; gap: 6px; align-content: start; }
.filters .cols { display: grid; gap: 12px 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.badge { background: var(--accent); color: var(--on-accent); border-radius: 999px; font-size: .72rem; font-weight: 700; padding: 0 .45rem; margin-left: .3rem; }

/* ---------- Cartes d'idées ---------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.idea {
  display: flex; flex-direction: column; gap: 10px; text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 20px; padding: 16px; position: relative;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.idea:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 16px 36px rgba(0, 0, 0, .25); }
.idea.both { border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent) inset; }
.idea h3 { margin: 0; padding-right: 2rem; }
.idea .desc { color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.idea .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.idea .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; font-size: .82rem; color: var(--muted); }
.hearts { display: inline-flex; gap: 4px; align-items: center; }
.heart-btn { font: inherit; cursor: pointer; border: 1px solid var(--card-border); background: rgba(0, 0, 0, .2); color: var(--text); border-radius: 999px; padding: .2rem .6rem; display: inline-flex; gap: .3rem; align-items: center; }
.heart-btn.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 25%, transparent); }
.stars { color: var(--accent2); letter-spacing: .05em; }
.badge-both { position: absolute; top: 12px; right: 12px; font-size: 1.1rem; }

.empty { text-align: center; padding: 50px 16px; }
.empty .big { font-size: 3rem; }

.fab { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 30; padding: .95rem 1.5rem; font-size: 1rem; }

/* ---------- Modales ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(10, 0, 8, .65); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 14px; animation: fade .2s; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(620px, 100%); max-height: calc(100dvh - 28px); overflow-y: auto; background: var(--card-solid); border: 1px solid var(--card-border);
  border-radius: 22px; padding: clamp(16px, 4vw, 26px); animation: sceneIn .3s both; box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.modal-head h2 { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.actions.end { justify-content: flex-end; }
.detail-desc { white-space: pre-line; }
.review { padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, .2); margin-bottom: 10px; }
.review .who { display: flex; align-items: center; gap: .5rem; font-weight: 600; margin-bottom: 4px; }
.starpick { display: inline-flex; gap: 2px; }
.starpick button { font-size: 1.6rem; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--muted); padding: 0 2px; }
.starpick button.on { color: var(--accent2); }
.pick-banner { text-align: center; margin-bottom: 14px; }
.pick-banner .dice { font-size: 2.6rem; display: inline-block; animation: roll .8s; }
@keyframes roll { from { transform: rotate(-360deg) scale(.4); opacity: 0; } }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick button { font-size: 1.4rem; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--card-border); background: transparent; cursor: pointer; }
.emoji-pick button[aria-pressed='true'] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 25%, transparent); }

/* ---------- Auth ---------- */
.auth { max-width: 440px; margin: 8vh auto 0; }
.auth .logo { font-size: 3rem; text-align: center; }

.toast { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 100; padding: .6rem 1.2rem; border-radius: 999px; background: var(--ok); color: #05281a; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); max-width: 92vw; }
.toast.err { background: var(--bad); color: #330505; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .floater { display: none; }
}

/* ---------- Idées : entrée animée uniquement au changement d'onglet ---------- */
.idea.enter { animation: sceneIn .4s both; }
.tag.booked { background: color-mix(in srgb, var(--ok) 28%, transparent); font-weight: 600; }
.tag.booked.pending { background: color-mix(in srgb, var(--accent2) 35%, transparent); }

/* ---------- En-tête : cloche ---------- */
.header-right { display: flex; align-items: center; gap: 8px; }
.bell { position: relative; font-size: 1.1rem; height: 42px; min-width: 42px; border-radius: 999px; background: var(--card); }
.bell .badge { position: absolute; top: -4px; right: -4px; margin: 0; }
.notifs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.notif { width: 100%; display: flex; gap: 10px; text-align: left; font: inherit; color: inherit; cursor: pointer; padding: .7rem .8rem; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid transparent; }
.notif.unread { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.notif .ni { font-size: 1.3rem; }
.notif .nt { display: grid; gap: 2px; }

/* ---------- Calendrier ---------- */
.calendar { display: grid; gap: 16px; }
.section { display: grid; gap: 10px; }
.section h3 { margin: 0; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-title { font-family: var(--serif); font-size: 1.15rem; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-grid .wd { text-align: center; font-size: .72rem; color: var(--muted); padding-bottom: 4px; }
.cell {
  position: relative; aspect-ratio: 1 / 1; min-height: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font: inherit; color: var(--text); background: rgba(0, 0, 0, .16); border: 1px solid transparent; border-radius: 12px; cursor: pointer;
}
.cell.empty { background: none; cursor: default; }
.cell:hover:not(.empty) { border-color: var(--accent); }
.cell.today { border-color: var(--accent2); }
.cell.sel { background: color-mix(in srgb, var(--accent) 30%, transparent); border-color: var(--accent); }
.dots { display: flex; gap: 3px; }
.dots i, .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--accent2); }
.dots i.accepted, .dot.accepted { background: var(--ok); }
.legend { display: flex; gap: 14px; margin-top: 10px; justify-content: center; }

.bk { display: flex; gap: 12px; padding: 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--card-border); }
.bk.pending { border-color: var(--accent2); }
.bk.accepted { border-color: color-mix(in srgb, var(--ok) 60%, transparent); }
.bk.declined, .bk.cancelled { opacity: .6; }
.datebadge { flex: none; width: 52px; height: 58px; border-radius: 12px; display: grid; place-items: center; align-content: center; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--on-accent); }
.datebadge .dm { font-size: .68rem; text-transform: uppercase; font-weight: 700; letter-spacing: .05em; line-height: 1; }
.datebadge .dd { font-size: 1.4rem; font-weight: 700; line-height: 1.1; }
.bk-body { min-width: 0; flex: 1; }
.bk-title { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; text-decoration: none; color: var(--text); padding: 0; text-align: left; }
.bk-note { font-style: italic; color: var(--muted); }
.calendar { max-width: 640px; margin: 0 auto; width: 100%; }
.calendar > *, .section > * { min-width: 0; }
.cell { min-width: 0; }
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
@media (max-width: 480px) { .tab { padding: .5rem .7rem; font-size: .92rem; } }
