/*
 * Template TotalContest « TropSexy » : sombre, rose et or, pensé pour le téléphone.
 * Autonome : fonctionne aussi sans le thème TropSexy (couleurs et polices de secours ci-dessous).
 */
.totalcontest-wrapper {
  --tst-bg: #120b10;
  --tst-surface: #1c1219;
  --tst-surface-2: #281a24;
  --tst-line: #3a2a35;
  --tst-text: #f7eef3;
  --tst-soft: #e6d8e0;
  --tst-muted: #ae98a6;
  --tst-rose: #ff3d7f;
  --tst-coral: #ff8a5c;
  --tst-gold: #f6d683;
  --tst-gold-2: #c48a2c;
  --tst-ok: #5fd39a;
  --tst-error: #ff7d8c;
  --tst-brand: linear-gradient(120deg, var(--tst-rose), var(--tst-coral));
  --tst-display: "Fraunces", Georgia, "Times New Roman", serif;
  --tst-ui: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--tst-text);
  font-family: var(--tst-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.totalcontest-wrapper *, .totalcontest-wrapper *::before, .totalcontest-wrapper *::after { box-sizing: border-box; }
.totalcontest-wrapper a { color: inherit; }
.totalcontest-wrapper .tst-i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ----- Puces (menu, filtres, tris, catégorie) ----- */
.totalcontest-wrapper .tst-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin: 0; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.totalcontest-wrapper .tst-chips::-webkit-scrollbar { display: none; }
.totalcontest-wrapper .tst-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 15px; border-radius: 999px; background: var(--tst-surface); border: 1px solid var(--tst-line); color: var(--tst-soft); font-size: 13.5px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.totalcontest-wrapper .tst-chip:hover { color: var(--tst-text); }
.totalcontest-wrapper .tst-chip.is-active { background: var(--tst-text); border-color: var(--tst-text); color: var(--tst-bg); }
.totalcontest-wrapper .tst-chip-sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.totalcontest-wrapper .tst-sort { padding-top: 0; }

/* ----- Mosaïque des participations ----- */
.totalcontest-wrapper .tst-grid { column-count: 2; column-gap: 6px; }
@media (min-width: 640px) { .totalcontest-wrapper .tst-grid { column-count: 3; } }
@media (min-width: 1000px) { .totalcontest-wrapper .tst-grid { column-count: 4; } }
.totalcontest-wrapper .tst-item { break-inside: avoid; margin: 0 0 6px; width: auto !important; }
.totalcontest-wrapper .tst-link { position: relative; display: block; border-radius: 14px; overflow: hidden; background: var(--tst-surface-2); text-decoration: none; }
.totalcontest-wrapper .tst-link img, .totalcontest-wrapper .tst-img { display: block; width: 100%; height: auto; }
.totalcontest-wrapper .tst-votes { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px 0 7px; border-radius: 999px; background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.totalcontest-wrapper .tst-votes .tst-i { width: 14px; height: 14px; }
.totalcontest-wrapper .tst-winner { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px 0 7px; border-radius: 8px; background: linear-gradient(135deg, var(--tst-gold), var(--tst-gold-2)); color: #2b1a05; font-size: 12px; font-weight: 800; }
.totalcontest-wrapper .tst-winner .tst-i { width: 14px; height: 14px; }
.totalcontest-wrapper .tst-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 16px; color: var(--tst-muted); text-align: center; }
.totalcontest-wrapper .tst-empty .tst-i { width: 34px; height: 34px; }

.totalcontest-wrapper .tst-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 18px 0 6px; }
.totalcontest-wrapper .tst-select { height: 36px; padding: 0 12px; border-radius: 999px; background: var(--tst-surface); border: 1px solid var(--tst-line); color: var(--tst-text); font: inherit; font-size: 13.5px; font-weight: 700; }

/* ----- Page d'une photo ----- */
.totalcontest-wrapper .tst-photo-page { display: flex; flex-direction: column; gap: 14px; max-width: 900px; margin: 0 auto; }
.totalcontest-wrapper .tst-figure { position: relative; border-radius: 18px; overflow: hidden; background: #000; }
.totalcontest-wrapper .tst-figure img { display: block; width: 100%; height: auto; max-height: 82vh; object-fit: contain; margin: 0 auto; }
.totalcontest-wrapper .tst-figure.is-winner { box-shadow: 0 0 0 2.5px var(--tst-gold); }
.totalcontest-wrapper .tst-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.totalcontest-wrapper .tst-author { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.totalcontest-wrapper .tst-author img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; }
.totalcontest-wrapper .tst-author strong { display: block; font-size: 15px; }
.totalcontest-wrapper .tst-muted { display: block; color: var(--tst-muted); font-size: 12.5px; }
.totalcontest-wrapper .tst-stats { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--tst-soft); font-size: 14px; }
.totalcontest-wrapper .tst-stat { display: inline-flex; align-items: center; gap: 6px; }
.totalcontest-wrapper .tst-stat strong { color: var(--tst-text); font-variant-numeric: tabular-nums; }
.totalcontest-wrapper .tst-stat:first-child .tst-i { color: var(--tst-rose); fill: currentColor; stroke: none; }

/* ----- Messages ----- */
.totalcontest-wrapper .tst-message { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--tst-surface); border: 1px solid var(--tst-line); color: var(--tst-soft); }
.totalcontest-wrapper .tst-message .tst-i { margin-top: 2px; }
.totalcontest-wrapper .tst-message.is-error { border-color: rgba(255, 125, 140, .45); color: var(--tst-error); }
.totalcontest-wrapper .tst-message.is-ok { border-color: rgba(95, 211, 154, .45); color: var(--tst-ok); }

/* ----- Boutons ----- */
.totalcontest-wrapper .tst-btn,
.totalcontest-wrapper .totalcontest-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 14px; border: 0; background: var(--tst-brand); color: #fff; font: inherit; font-size: 15.5px; font-weight: 800; text-decoration: none; cursor: pointer; box-shadow: 0 10px 26px rgba(255, 61, 127, .28); }
.totalcontest-wrapper .tst-btn-line { background: transparent; border: 1px solid var(--tst-line); color: var(--tst-text); box-shadow: none; min-height: 42px; font-size: 14px; }
.totalcontest-wrapper .totalcontest-button[disabled] { opacity: .5; cursor: progress; }
.totalcontest-wrapper .tst-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.totalcontest-wrapper .tst-buttons .totalcontest-button { flex: 1 1 100%; }
.totalcontest-wrapper .tst-vote-btn .totalcontest-button { min-height: 56px; font-size: 17px; }
.totalcontest-wrapper .tst-vote-btn .totalcontest-button::before { content: ""; width: 22px; height: 22px; background: currentColor; -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 20.3s-7.6-4.5-9.4-9.3C1.3 7.6 3.5 4.3 7 4.3c2 0 3.6 1.1 5 3.1 1.4-2 3-3.1 5-3.1 3.5 0 5.7 3.3 4.4 6.7-1.8 4.8-9.4 9.3-9.4 9.3z'/></svg>") center / contain no-repeat; mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 20.3s-7.6-4.5-9.4-9.3C1.3 7.6 3.5 4.3 7 4.3c2 0 3.6 1.1 5 3.1 1.4-2 3-3.1 5-3.1 3.5 0 5.7 3.3 4.4 6.7-1.8 4.8-9.4 9.3-9.4 9.3z'/></svg>") center / contain no-repeat; }
.totalcontest-wrapper .tst-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ----- Envoi de photo ----- */
.totalcontest-wrapper .tst-intro { margin: 0 0 16px; }
.totalcontest-wrapper .tst-title { margin: 0 0 4px; font: 600 italic 28px/1.15 var(--tst-display); color: var(--tst-text); }
.totalcontest-wrapper .tst-intro p { margin: 0; color: var(--tst-muted); }
.totalcontest-wrapper .tst-tip { margin-top: 12px !important; padding: 12px 14px; border-radius: 14px; background: var(--tst-surface); border: 1px solid var(--tst-line); color: var(--tst-soft) !important; }
.totalcontest-wrapper .totalcontest-form-custom-fields { margin-bottom: 18px; }
.totalcontest-wrapper .totalcontest-form-page { display: flex; flex-direction: column; gap: 18px; }
.totalcontest-wrapper .totalcontest-form-field-label { display: block; margin: 0 0 8px; font-weight: 750; font-size: 14px; color: var(--tst-text); }
.totalcontest-wrapper .totalcontest-form-field-input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.totalcontest-wrapper select.totalcontest-form-field-input,
.totalcontest-wrapper textarea.totalcontest-form-field-input { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 13px; border: 1px solid var(--tst-line); background: var(--tst-surface); color: var(--tst-text); font: inherit; font-size: 16px; }
.totalcontest-wrapper textarea.totalcontest-form-field-input { min-height: 110px; }
.totalcontest-wrapper .totalcontest-form-field-input:focus { outline: none; border-color: var(--tst-rose); }
/* Zone d'envoi de photo : tout le cadre est le bouton (le vrai champ, invisible, le recouvre) */
.totalcontest-wrapper .totalcontest-form-field-type-file .totalcontest-form-field-wrapper { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 170px; padding: 22px 16px; border-radius: 18px; border: 1.5px dashed rgba(255, 61, 127, .55); background: var(--tst-surface); color: var(--tst-soft); text-align: center; overflow: hidden; transition: border-color .15s, background-color .15s; }
.totalcontest-wrapper .totalcontest-form-field-type-file.is-over .totalcontest-form-field-wrapper,
.totalcontest-wrapper .totalcontest-form-field-type-file .totalcontest-form-field-wrapper:hover { border-color: var(--tst-rose); background: var(--tst-surface-2); }
.totalcontest-wrapper .totalcontest-form-field-type-file.has-file .totalcontest-form-field-wrapper { border-style: solid; border-color: var(--tst-line); }
.totalcontest-wrapper .totalcontest-form-field-type-file input[type="file"] { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; font-size: 0; }
.totalcontest-wrapper .totalcontest-form-field-placeholder-wrapper { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
/* Le label vide reçoit de TotalContest le nom et la taille du fichier : notre aperçu les montre déjà. */
.totalcontest-wrapper .totalcontest-form-field-placeholder-wrapper > label { display: none; }
.totalcontest-wrapper .totalcontest-form-field-placeholder { display: flex; flex-direction: column; align-items: center; gap: 10px; font-weight: 750; font-size: 15px; color: var(--tst-text); overflow-wrap: anywhere; }
.totalcontest-wrapper .totalcontest-form-field-type-file:not(.has-file) .totalcontest-form-field-placeholder::before { content: ""; width: 52px; height: 52px; border-radius: 16px; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 16V5M7 9.5 12 4.5l5 5M5 19.5h14'/></svg>") center / 26px no-repeat, var(--tst-brand); box-shadow: 0 10px 26px rgba(255, 61, 127, .28); }
.totalcontest-wrapper .totalcontest-form-field-type-file.has-file .totalcontest-form-field-placeholder { font-size: 13px; font-weight: 600; color: var(--tst-muted); }
.totalcontest-wrapper .tst-preview { display: block; max-width: 100%; max-height: 300px; border-radius: 12px; object-fit: contain; }
.totalcontest-wrapper .totalcontest-form-field-type-file .totalcontest-form-field-errors { position: relative; z-index: 3; }
.totalcontest-wrapper .totalcontest-form-field-split { margin: -8px 0; color: var(--tst-muted); font-size: 13px; text-align: center; }

/* Cases et boutons radio : la case à gauche, le texte à droite */
.totalcontest-wrapper .totalcontest-form-field-radio,
.totalcontest-wrapper .totalcontest-form-field-checkbox { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.totalcontest-wrapper .totalcontest-form-field-checkbox { flex-direction: column; align-items: stretch; }
.totalcontest-wrapper .totalcontest-form-field-radio > label,
.totalcontest-wrapper .totalcontest-form-field-checkbox-item > label { display: inline; margin: 0 6px 0 0; font-weight: 500; font-size: 14px; color: var(--tst-soft); cursor: pointer; }
.totalcontest-wrapper .totalcontest-form-field-checkbox-item { display: flex; align-items: flex-start; gap: 10px; line-height: 1.45; }
.totalcontest-wrapper input[type="checkbox"], .totalcontest-wrapper input[type="radio"] { -webkit-appearance: auto; appearance: auto; width: 22px; height: 22px; min-height: 0; flex: none; margin: 0; padding: 0; accent-color: var(--tst-rose); cursor: pointer; }

/* Conditions et consentement, juste avant le bouton */
.totalcontest-wrapper .tst-rules { margin: 0 0 14px; padding: 14px 14px 4px; border-radius: 14px; background: var(--tst-surface); border: 1px solid var(--tst-line); }
.totalcontest-wrapper .tst-rules-title { display: block; margin-bottom: 6px; font-size: 14px; color: var(--tst-text); }
.totalcontest-wrapper .tst-rules-text { max-height: 190px; overflow-y: auto; padding-right: 6px; color: var(--tst-soft); font-size: 13.5px; line-height: 1.5; -webkit-overflow-scrolling: touch; }
.totalcontest-wrapper .tst-rules-text p { margin: 0 0 10px; }
.totalcontest-wrapper .tst-rules-text a, .totalcontest-wrapper .tst-consent a { color: var(--tst-rose); text-decoration: underline; }
.totalcontest-wrapper .tst-consent .totalcontest-form-page { gap: 10px; }
.totalcontest-wrapper .tst-consent .totalcontest-form-field-wrapper > .totalcontest-form-field-label { display: none; }
.totalcontest-wrapper .tst-consent .totalcontest-form-field { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--tst-line); transition: border-color .15s; }
.totalcontest-wrapper .tst-consent .totalcontest-form-field.is-missing { border-color: var(--tst-error); }
.totalcontest-wrapper .tst-consent .totalcontest-form-field.is-missing::after { content: "Coche cette case pour envoyer ta photo."; display: block; margin-top: 6px; color: var(--tst-error); font-size: 13px; font-weight: 600; }
.totalcontest-wrapper .totalcontest-form-field-errors { color: var(--tst-error); font-size: 13px; font-weight: 600; }
.totalcontest-wrapper .totalcontest-form-field-errors:empty { display: none; }
.totalcontest-wrapper .tst-loading { display: none; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 14px; border-radius: 14px; background: var(--tst-surface); color: var(--tst-soft); font-weight: 700; }
.totalcontest-wrapper .tst-loading.active { display: flex !important; }
.totalcontest-wrapper .tst-spin { display: block; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--tst-line); border-top-color: var(--tst-rose); animation: tst-spin .8s linear infinite; }
@keyframes tst-spin { to { transform: rotate(360deg); } }

/* ----- Fin d'envoi, pages ----- */
.totalcontest-wrapper .tst-done { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 16px; text-align: center; }
.totalcontest-wrapper .tst-done p { margin: 0; color: var(--tst-soft); max-width: 46ch; }
.totalcontest-wrapper .tst-done .tst-row { justify-content: center; }
.totalcontest-wrapper .tst-ok { width: 68px; height: 68px; border-radius: 50%; background: var(--tst-brand); color: #fff; display: grid; place-items: center; }
.totalcontest-wrapper .tst-ok .tst-i { width: 34px; height: 34px; stroke-width: 2.4; }
.totalcontest-wrapper .tst-page { color: var(--tst-soft); }

/* ----- Partage ----- */
.totalcontest-wrapper .tst-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 18px; color: var(--tst-muted); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  .totalcontest-wrapper .tst-spin { animation: none; }
}

/* ----- Titre et description d'une photo ----- */
.totalcontest-wrapper .tst-caption { display: flex; flex-direction: column; gap: 4px; }
.totalcontest-wrapper .tst-caption-title { margin: 0; font: 600 italic 22px/1.2 var(--tst-display); color: var(--tst-text); overflow-wrap: anywhere; }
.totalcontest-wrapper .tst-caption-desc { margin: 0; color: var(--tst-soft); font-size: 15px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
