/* Closer Time · Wedding Editor */

:root {
  --ink: #262238;
  --muted: #858195;
  --line: #ebe8f2;
  --surface: #ffffff;
  --page: #f8f7fc;
  --purple: #7650ed;
  --purple-dark: #6339dc;
  --radius: 18px;
  --shadow: 0 12px 34px rgba(42, 27, 86, .08);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  scroll-padding-bottom: 110px;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Montserrat", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(118, 80, 237, .28);
  outline-offset: 2px;
}

.app-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(18px, 4vw, 54px);
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.7px;
}

.app-header > span {
  color: var(--muted);
  font-size: 12px;
}

.editor-layout {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 30px clamp(16px, 3vw, 34px) 130px;
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  align-items: start;
  gap: clamp(24px, 4vw, 54px);
}

.preview-column {
  position: sticky;
  top: 22px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-heading {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--purple);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.45px;
}

.section-heading h1,
.controls-column > h2 {
  margin: 0;
  font-size: clamp(22px, 2.3vw, 29px);
  letter-spacing: -.9px;
  line-height: 1.15;
}

.live-indicator {
  flex: 0 0 auto;
  color: #4e946f;
  font-size: 11px;
  font-weight: 600;
}

/* Carte d'invitation compacte et élégante */

/* Viewer-sized preview, scaled down for the Wedding editor */
.preview-viewport {
  width: 281px;
  height: 608px;
  flex: 0 0 auto;
  position: relative;
  margin: 0 auto;
}


.preview-viewport .invitation-card.viewer-frame {
  --gradient-start: #ef91d1;
  --gradient-end: #9a7af4;

  position: absolute;
  top: 0;
  left: 50%;

  width: 390px;
  height: 844px;
  min-width: 390px;
  max-width: none;
  min-height: 844px;
  aspect-ratio: auto;
  box-sizing: border-box;

  transform: translateX(-50%) scale(.72);
  transform-origin: top center;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;

  background: linear-gradient(
    to bottom,
    var(--gradient-start) 0%,
    var(--gradient-end) 100%
  );

  color: #000;
  text-align: center;
  box-shadow: 0 12px 30px rgba(42, 27, 86, .12);
  container-type: normal;
}


/* Logo */
.preview-logo-btn {
  position: absolute;
  top: 35px;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 130px;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}

.preview-logo-btn .invitation-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Names and subtitle */
#previewTitle {
  width: 100%;
  margin: 0 0 18px;
  padding: 0 15px;
  font-family: "Great Vibes", cursive;
  font-size: 64px;
  font-weight: 400;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

#previewSubtitle {
  margin: 0;
  padding: 0 18px;
  font-family: "Playfair Display", serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* Years line */
#yearsLine {
  display: none;
  margin: 8px 0 12px;
  text-align: center;
  font-family: "Great Vibes", cursive;
  font-size: 34px;
}

#yearsText {
  display: inline-block;
}

/* Countdown */
.preview-viewport .countdown {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin: 12px 0 30px;
  font-variant-numeric: lining-nums tabular-nums;
}



.preview-viewport .time-box span {
  display: block;
  font-family: "Cormorant Garamond", serif;
  font-size: 70px;
  font-style: italic;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: lining-nums tabular-nums;
}

.preview-viewport .time-box p {
  margin: 10px 0 0;
  font-family: "Playfair Display", serif;
  font-size: 12px;
  font-weight: 400;
  text-transform: lowercase;
}

.preview-viewport .time-box {
  width: auto;
  min-width: 0;
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.preview-viewport .separator {
  width: 8px;
  flex: 0 0 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
  margin-right: 8px;
}

.preview-viewport .separator .dot {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: currentColor;
}

/* Event date and time */
#previewDate {
  margin: -12px 0 0;
  padding: 0 12px;
  font-family: "Playfair Display", serif;
  font-size: 34px;
  font-weight: 400;
  line-height: 1.2;
}

#previewTime {
  margin: -8px 0 0;
  padding: 0 12px;
  font-family: "Playfair Display", serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.2;
}

#previewLocation {
  margin: 8px 0 0;
  font-family: "Playfair Display", serif;
  font-size: 16px;
  line-height: 1.3;
  opacity: .9;
}

/* Viewer-style bottom button mockup */
.preview-back-mock {
  position: absolute;
  bottom: 35px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 90%;
  padding: 9px 22px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 24px;
  background: rgba(255, 255, 255, .25);
  backdrop-filter: blur(6px);
  color: #4d3b5d;
  font-family: "Playfair Display", serif;
  font-size: 16px;
  white-space: nowrap;
}

.preview-note {
  margin: 13px 4px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}


.controls-column { min-width: 0; }
.controls-column > h2 { margin-bottom: 8px; }

.controls-column > p:not(.eyebrow) {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.settings-card {
  margin: 0 0 14px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 5px 20px rgba(42, 27, 86, .035);
}

.settings-card h3 {
  margin: 0 0 17px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.2px;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  background: #f3f1f8;
  border-radius: 11px;
}

.segmented-control button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #777186;
  font-size: 12px;
  font-weight: 600;
}

.segmented-control button.is-selected {
  background: #fff;
  color: var(--purple-dark);
  box-shadow: 0 2px 8px rgba(37, 24, 70, .09);
}

#picker {
  display: flex;
  justify-content: center;
  margin: 0 auto 16px;
}

.color-fields {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  align-items: end;
  gap: 10px;
}

.color-fields > label {
  grid-row: 1;
  color: #777186;
  font-size: 10px;
  font-weight: 600;
}

.color-fields > label:first-of-type { grid-column: 1; }
.color-fields > label:nth-of-type(2) { grid-column: 3; }

.color-fields input[type="color"] {
  width: 100%;
  height: 40px;
  min-width: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

#colorTop { grid-column: 1; }
#colorBottom { grid-column: 3; }

#reverseColors {
  grid-column: 2;
  grid-row: 2;
  width: 39px;
  height: 39px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--purple);
  font-size: 19px;
}

.settings-card > label:not(.sr-only) {
  display: block;
  margin: 15px 0 7px;
  color: #5f5a70;
  font-size: 11px;
  font-weight: 600;
}

.settings-card input[type="text"],
.settings-card input[type="datetime-local"],
.settings-card select {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid #e4e0ed;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}

.settings-card input:focus,
.settings-card select:focus {
  border-color: #a58df5;
  outline: 3px solid rgba(118, 80, 237, .1);
}

.field-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.purchase-bar {
  position: fixed;
  z-index: 50;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 13px max(20px, env(safe-area-inset-left))
    calc(13px + env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-right));
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 28px rgba(42, 27, 86, .07);
  backdrop-filter: blur(16px);
}

.purchase-bar > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.purchase-bar > div span {
  color: var(--muted);
  font-size: 10px;
}

.purchase-bar > div strong { font-size: 20px; }

#btn-buy {
  min-height: 50px;
  min-width: min(330px, 60vw);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 23px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #8059f3, #673ee1);
  color: #fff;
  box-shadow: 0 8px 18px rgba(103, 62, 225, .23);
  font-size: 12px;
  font-weight: 700;
  transition: transform .15s ease, box-shadow .15s ease;
}

#btn-buy:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(103, 62, 225, .29);
}

#btn-buy:active { transform: translateY(0); }

.publish-arrow { font-size: 18px; line-height: 1; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Responsivité Mobile */
@media (max-width: 860px) {
  .editor-layout {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 14px 14px 155px;
  }

  .preview-column {
    position: relative;
    top: auto;
    z-index: auto;
    width: 100%;
    padding: 12px;
    background: rgba(248,247,252,.97);
    border: 1px solid rgba(235,232,242,.9);
    border-radius: 18px;
    box-shadow: 0 8px 22px rgba(42,27,86,.08);
  }

    .preview-viewport {
    width: 281px;
    max-width: 100%;
    height: 608px;
    flex: 0 0 auto;
  }

}


/* Alignement des commandes avec wedding.html */

.preview-heading-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
}

.preview-heading-row > div {
  min-width: 0;
}

.preview-heading-row h1 {
  margin: 0;
  font-size: clamp(22px, 2.3vw, 29px);
  letter-spacing: -.9px;
  line-height: 1.15;
}

.controls-heading {
  margin-bottom: 8px;
}

.controls-heading h2 {
  margin: 0;
  font-size: clamp(22px, 2.3vw, 29px);
  letter-spacing: -.9px;
  line-height: 1.15;
}

.section-intro {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.settings-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
}

.settings-title-row h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.2px;
}

.step-number {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #f0ebff;
  color: var(--purple-dark);
  font-size: 12px;
  font-weight: 700;
}

.field {
  min-width: 0;
  margin-top: 15px;
}

.field label,
.swatch-field label {
  display: block;
  margin: 0 0 7px;
  color: #5f5a70;
  font-size: 11px;
  font-weight: 600;
}

.color-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.color-wheel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.gradient-swatches {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  width: 100%;
}

.swatch-field {
  min-width: 0;
}

.swatch-input-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.color-swatch {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.swatch-input-row input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px;
  border: 1px solid #e4e0ed;
  border-radius: 9px;
  font-size: 11px;
}

@media (max-width: 480px) {
  .settings-card {
    padding: 16px;
  }

  .gradient-swatches {
    gap: 6px;
  }

  .swatch-input-row {
    gap: 5px;
  }

  .color-swatch {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }

  .swatch-input-row input {
    padding: 7px 5px;
    font-size: 10px;
  }
}

/* Proportions de référence du Viewer - Ajustement propre du compteur */
.preview-viewport .invitation-card.viewer-frame {
  padding: 40px 10px;
}

.preview-logo-btn {
  top: 30px;
}

#previewTitle {
  margin: 75px 0 10px;
  font-size: 42px;
}

#previewSubtitle {
  font-size: 18px;
  line-height: 1.3;
  margin-bottom: 5px;
}

.preview-viewport .countdown {
  gap: 0;
  margin: 8px 0 20px;
  width: 100%;
}

.preview-viewport .time-box {
  width: 58px;
  flex: 0 0 58px;
}

.preview-viewport .time-box span {
  font-size: 40px;
}

.preview-viewport .time-box p {
  margin-top: 6px;
  font-size: 11px;
}

.preview-viewport .separator {
  width: 6px;
  flex: 0 0 6px;
  margin-left: 4px;
  margin-right: 4px;
  padding-bottom: 20px;
}

#previewDate {
  margin: -12px 0 0;
  padding: 0 12px;
  font-family: "Playfair Display", serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
}

#previewTime {
  margin: 4px 0 0;
  padding: 0 12px;
  font-family: "Playfair Display", serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.2;
}

/* --- PROPORTIONNALITÉ STRICTE DE L'ÉDITEUR (COPIE FIDÈLE DU VIEWER) --- */
.preview-viewport .countdown {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0px;
  margin: 12px 0 30px;
  width: 100%;
}

.preview-viewport .time-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: auto;
  flex: 0 1 auto;
}

.preview-viewport .time-box span {
  font-family: "Cormorant Garamond", serif;
  font-size: 46px;
  font-style: italic;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum", "tnum";
}

.preview-viewport .time-box p {
  font-size: 12px;
  margin-top: 10px;
  text-transform: lowercase;
  font-family: Georgia, serif;
}

.preview-viewport .separator {
  width: 8px;
  flex: 0 0 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
  margin-right: 8px;
  padding-bottom: 18px;
}

.preview-viewport .separator .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
}

/* --- CORRECTIF DÉFINITIF SECTION COULEURS --- */
.color-editor {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 15px !important;
}

.gradient-swatches {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  width: 100% !important;
  margin-top: 10px !important;
}

.swatch-field {
  flex: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

.swatch-field label {
  margin-bottom: 5px !important;
  color: #5f5a70 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
}

.swatch-input-row {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: #fff !important;
  border: 1px solid #e4e0ed !important;
  border-radius: 10px !important;
  padding: 6px 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.color-swatch {
  width: 28px !important;
  height: 28px !important;
  flex: 0 0 28px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(0, 0, 0, 0.2) !important;
  cursor: pointer !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08) !important;
}

.swatch-input-row input {
  width: 100% !important;
  min-width: 0 !important;
  border: none !important;
  background: transparent !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: var(--ink) !important;
  outline: none !important;
  padding: 0 !important;
}

.swap-colors {
  width: 38px !important;
  height: 38px !important;
  flex: 0 0 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid #e4e0ed !important;
  border-radius: 10px !important;
  background: #f8f7fc !important;
  color: #7650ed !important;
  font-size: 16px !important;
  cursor: pointer !important;
  margin-top: 18px !important; /* S'aligne parfaitement avec les champs de texte en dessous du label */
  transition: background 0.2s ease !important;
}

.swap-colors:hover {
  background: #f0ebff !important;
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand-link {
  display: flex !important;
  align-items: center !important;
  gap: 10px;
}

.brand-text {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

.brand-name {
  font-size: 1.2rem;
  font-weight: bold;
  line-height: 1;
}

.brand-tagline {
  font-size: 0.65rem;
  opacity: 0.8;
  letter-spacing: 0.5px;
}

/* Coque passive du smartphone */
.preview-viewport .phone-case {
  position: static;
  pointer-events: none;
}

/* Contour du téléphone */
.preview-viewport .phone-case::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 7px solid #202024;
  border-radius: 34px;
  box-shadow:
    inset 0 0 0 1px #555,
    0 8px 20px rgba(0, 0, 0, 0.18);
  box-sizing: border-box;
  pointer-events: none;
  z-index: 5;
}

/* Caméra frontale */
.preview-viewport .phone-notch {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #080808;
  border: 2px solid #444;
  box-sizing: content-box;
  z-index: 6;
  pointer-events: none;
}

/* Masque les coins carrés de l'invitation rose pour épouser la coque */
.preview-viewport .invitation-card, 
.preview-viewport .viewer-frame {
  border-radius: 32px !important;
  overflow: hidden !important;
}

/* Arrondit le contenu intérieur pour épouser la coque du téléphone */
.preview-viewport {
  overflow: hidden !important;
  border-radius: 34px !important;
}

/* Forcer la lisibilité parfaite sur mobile et bureau pour les formulaires */
.customization-section label, 
.customization-panel label,
.form-group label,
h3.section-title,
.section-heading,
[class*="customization"] label,
[class*="customization"] span,
.control-label {
  font-weight: 700 !important;
  color: #000000 !important; /* Noir absolu */
  font-size: 1.1rem !important;
}

/* Texte saisi et menus déroulants bien noirs et épais */
input[type="text"], 
input[type="datetime-local"], 
select, 
textarea,
.customization-panel input,
.customization-panel select {
  font-weight: 600 !important;
  color: #000000 !important;
  font-size: 1rem !important;
}

/* Texte d'aide gris un peu plus sombre */
.help-text, 
small, 
.form-text {
  color: #333338 !important;
  font-weight: 500 !important;
}

/* Ajustement précis et élégant en pixels pour les libellés */
label,
.form-label,
.field-label,
.input-label,
.customization-section label,
.customization-panel label,
div[class*="label"],
p[class*="label"],
span[class*="label"] {
  color: #1a1a1e !important;       
  font-weight: 500 !important;     
  font-size: 15px !important;     /* Taille idéale : ni trop minuscule, ni trop grosse */
  margin-bottom: 4px !important;   
  display: block !important;
}

/* Texte saisi à l'intérieur des boîtes */
input,
select,
textarea {
  color: #111111 !important;
  font-weight: 500 !important;
  font-size: 15px !important;
}

/* =========================================
   CELEBRATION - GIF SEARCH & CATEGORIES
   ========================================= */

.gif-library {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.gif-search {
  width: 100%;
  min-width: 0;
}

.gif-search label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
}

.gif-search input {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #e5e1ef;
  border-radius: 12px;
  background: #fff;
  color: #19152d;
  font: inherit;
  outline: none;
}

.gif-search input:focus {
  border-color: #7547ff;
  box-shadow: 0 0 0 3px rgba(117, 71, 255, 0.12);
}

.gif-category-viewport {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x;
}

.gif-category-viewport::-webkit-scrollbar {
  display: none;
}

.gif-category-list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: max-content;
  min-width: 100%;
  padding: 2px 1px 8px;
}

.gif-category {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #ece8f5;
  border-radius: 12px;
  background: #f5f3fa;
  color: #39324f;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.gif-category:hover {
  border-color: #c9b8ff;
  background: #eee8ff;
}

.gif-category.is-active {
  border-color: #7041ff;
  background: #7041ff;
  color: #fff;
}

.gif-category:focus-visible {
  outline: 2px solid #7041ff;
  outline-offset: 3px;
}

@media (max-width: 600px) {
  .gif-library {
    gap: 12px;
  }

  .gif-category {
    min-height: 44px;
    padding: 0 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gif-category {
    transition: none;
  }
}

/* CELEBRATION - GIF CAROUSEL */

.gif-carousel {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 18px 0 24px;
}

.gif-carousel-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.gif-slide {
  position: relative;
  display: block;
  flex: 0 1 112px;
min-width: 0;
  height: 190px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 17px;
  background: #25212e;
  box-shadow: 0 5px 14px rgba(35, 25, 60, 0.14);
  cursor: pointer;
  transition:
    flex-basis 0.3s ease-out,
    height 0.3s ease-out,
    opacity 0.3s ease-out,
    transform 0.3s ease-out;
}

.gif-slide.gif-edge {
  flex: 0 1 65px;
  height: 135px;
  opacity: 0.4;
}

.gif-slide.gif-side {
  opacity: 0.78;
}

.gif-slide.is-active {
  flex: 0 1 138px;
  height: 230px;
  border-color: #7650ed;
  box-shadow: 0 0 0 3px rgba(118, 80, 237, 0.12),
              0 12px 25px rgba(35, 25, 60, 0.2);
  opacity: 1;
  transform: translateY(-3px);
}

.gif-placeholder {
  position: absolute;
  inset: 0;
  display: block;
  background-size: cover;
  background-position: center;
}

.gif-scene-1 {
  background: linear-gradient(160deg, #17234b, #a33868, #f5a66e);
}

.gif-scene-2 {
  background: radial-gradient(circle at 50% 35%, #ffd88b, transparent 25%),
              linear-gradient(145deg, #32165d, #e84f9c, #f5b8d4);
}

.gif-scene-3 {
  background: radial-gradient(circle at 30% 20%, #fff2c9, transparent 18%),
              radial-gradient(circle at 75% 65%, #ff8bc8, transparent 25%),
              linear-gradient(160deg, #ffb2d7, #d96bc4, #8560d9);
}

.gif-scene-4 {
  background: radial-gradient(circle at 30% 30%, #ffb7d2, transparent 20%),
              radial-gradient(circle at 70% 65%, #e86aa4, transparent 25%),
              linear-gradient(145deg, #521b50, #a63c75);
}

.gif-scene-5 {
  background: linear-gradient(160deg, #f5e8d5, #d8b8c9, #a7b9dc);
}

.gif-selection {
  position: absolute;
  z-index: 2;
  bottom: 7px;
  left: 50%;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #7650ed;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

@media (max-width: 600px) {
  .gif-carousel-track {
    gap: 7px;
  }

  .gif-slide {
    flex-basis: 75px;
    height: 145px;
    border-radius: 13px;
  }

  .gif-slide.gif-edge {
    flex-basis: 30px;
    height: 105px;
  }

  .gif-slide.is-active {
    flex-basis: 118px;
    height: 195px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gif-slide {
    transition: none;
  }
}

/* CELEBRATION : défilement des catégories à la souris */
.gif-category-viewport {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.gif-category-viewport.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.gif-category-viewport .gif-category {
  user-select: none;
  -webkit-user-select: none;
}

/* CELEBRATION : correction du débordement mobile */
@media (max-width: 600px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  .editor-layout,
  .controls-column,
  .settings-card,
  .gif-library {
    min-width: 0;
    max-width: 100%;
  }

  .gif-carousel {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .gif-carousel-track {
    width: 100%;
    max-width: 100%;
    justify-content: center;
  }

  .gif-category-viewport {
    width: 100%;
    max-width: 100%;
    touch-action: pan-x pan-y;
  }
}
