* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6c63ff;
  --primary-dark: #5a52d5;
  --secondary: #f0eeff;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f8f7ff;
  --card-bg: #ffffff;
  --text: #1e1b4b;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(108, 99, 255, 0.10);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== HEADER ===== */
.header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(108,99,255,0.06);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--primary);
}

.logo-icon { font-size: 1.6rem; }
.logo { cursor: pointer; user-select: none; transition: opacity 0.2s; }
.logo:hover { opacity: 0.75; }

.nav-tabs {
  display: flex;
  gap: 4px;
}

.tab {
  padding: 8px 18px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}

.tab:hover { background: var(--secondary); color: var(--primary); }

.tab.active {
  background: var(--primary);
  color: white;
}

/* ===== MAIN ===== */
.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 36px 24px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.section-title {
  margin-bottom: 28px;
}

.section-title h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
}

.section-title p {
  color: var(--text-muted);
  margin-top: 4px;
  font-size: 0.95rem;
}

/* ===== CARDS ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.card-icon { font-size: 1.4rem; }

.card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 16px;
  line-height: 1.6;
}

.card-desc code {
  background: var(--secondary);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.card-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.import-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .import-grid { grid-template-columns: 1fr; }
  .nav-tabs { gap: 2px; }
  .tab { padding: 8px 10px; font-size: 0.78rem; }
  .header { padding: 0 16px; }
}

/* ===== TEXTAREA ===== */
textarea {
  width: 100%;
  height: 180px;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  color: var(--text);
  resize: vertical;
  transition: border-color 0.2s;
  outline: none;
  line-height: 1.6;
}

textarea:focus { border-color: var(--primary); }

/* ===== DROP ZONE ===== */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: var(--secondary);
}

.drop-icon { font-size: 2.5rem; }
.drop-zone p { font-weight: 600; color: var(--text); }
.drop-hint { font-size: 0.82rem; color: var(--text-muted); }

/* ===== OPTIONS ===== */
.options-card { }

.options-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
}

.toggle-label input[type="checkbox"] { display: none; }

.toggle {
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: left 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.toggle-label input:checked + .toggle { background: var(--primary); }
.toggle-label input:checked + .toggle::after { left: 23px; }

.keyword-input input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.keyword-input input:focus { border-color: var(--primary); }

/* ===== IMPORT STATUS ===== */
.import-status {
  padding: 14px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  margin-top: 8px;
}

.import-status.success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.import-status.error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.hidden { display: none !important; }

/* ===== BUTTONS ===== */
.btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

.btn-secondary {
  background: var(--secondary);
  color: var(--primary);
}

.btn-secondary:hover { background: #e0dcff; }

.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid var(--danger);
}

.btn-danger-outline:hover { background: #fef2f2; }

/* ===== PARTICIPANTS ===== */
.participants-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.participants-toolbar input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.participants-toolbar input:focus { border-color: var(--primary); }

.participants-list {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.participant-item {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  gap: 14px;
}

.participant-item:last-child { border-bottom: none; }
.participant-item:hover { background: var(--bg); }

.participant-num {
  width: 28px;
  height: 28px;
  background: var(--secondary);
  color: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.participant-info { flex: 1; min-width: 0; }

.participant-name {
  font-weight: 600;
  font-size: 0.95rem;
  truncate: ellipsis;
}

.participant-comment {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.participant-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
}

.participant-delete:hover { background: #fef2f2; color: var(--danger); }

/* ===== EMPTY STATE ===== */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 1rem; font-weight: 500; }
.empty-hint { font-size: 0.85rem; margin-top: 6px; }

/* ===== TIRAGE ===== */
.tirage-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.tirage-options {
  width: 100%;
}

.tirage-options .options-grid {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.option-item label { font-weight: 600; font-size: 0.92rem; }

.option-item input[type="number"] {
  width: 70px;
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

.option-item input[type="number"]:focus { border-color: var(--primary); }

/* Machine */
.machine {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.machine-screen {
  width: 380px;
  height: 220px;
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 40px rgba(49,46,129,0.4);
  position: relative;
  overflow: hidden;
}

.machine-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.08), transparent 60%);
}

.machine-idle { text-align: center; color: white; }
.machine-icon { font-size: 3rem; margin-bottom: 10px; }
.machine-idle p { font-size: 1rem; opacity: 0.7; font-weight: 500; }

.machine-rolling {
  text-align: center;
  color: white;
}

.rolling-name {
  font-size: 2rem;
  font-weight: 800;
  animation: rolling 0.1s linear infinite;
  letter-spacing: 1px;
}

@keyframes rolling {
  0% { opacity: 1; transform: translateY(0); }
  50% { opacity: 0.5; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}

.machine-result { text-align: center; color: white; }
.result-label { font-size: 0.85rem; opacity: 0.7; margin-bottom: 8px; }
.result-name {
  font-size: 2rem;
  font-weight: 800;
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.btn-tirage {
  padding: 18px 48px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 6px 24px rgba(108,99,255,0.4);
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.5px;
}

.btn-tirage:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(108,99,255,0.5);
}

.btn-tirage:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-tirage.spinning {
  animation: pulse 0.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* Results */
.results-container {
  width: 100%;
  background: white;
  border-radius: var(--radius);
  padding: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-align: center;
}

.results-container h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.winners-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.winner-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #fef9e7, #fffbf0);
  border: 1.5px solid #fbbf24;
  border-radius: 12px;
}

.winner-rank { font-size: 1.4rem; }

.winner-item-name {
  font-size: 1.05rem;
  font-weight: 700;
  flex: 1;
  text-align: left;
}

.winner-item-comment {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: left;
  margin-top: 2px;
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ===== MAGIC BOX ===== */
.magic-box {
  background: linear-gradient(135deg, #6c63ff, #a855f7);
  border-radius: 24px;
  padding: 36px 32px;
  text-align: center;
  color: white;
  box-shadow: 0 12px 48px rgba(108, 99, 255, 0.35);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.magic-box::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 70%);
  pointer-events: none;
}

.magic-icons {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 14px;
}

.magic-icon {
  font-size: 1.8rem;
  background: rgba(255,255,255,0.18);
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: transform 0.2s;
}

.magic-icon.active {
  transform: scale(1.15);
  background: rgba(255,255,255,0.35);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.magic-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.magic-sub {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-bottom: 24px;
}

.magic-input-wrap {
  position: relative;
  max-width: 560px;
  margin: 0 auto 14px;
}

.magic-detect {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  z-index: 2;
}

.magic-input {
  width: 100%;
  padding: 16px 20px 16px 54px;
  border: none;
  border-radius: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  outline: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.magic-input::placeholder { color: #9ca3af; }

.magic-hint {
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 22px;
  margin-bottom: 14px;
  opacity: 0.95;
}

.magic-hint.warn { color: #fde68a; }
.magic-hint.ok { color: #bbf7d0; }

.magic-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 0.9rem;
}

.spinner-white {
  border: 3px solid rgba(255,255,255,0.4);
  border-top-color: white;
}

.magic-btn {
  background: white;
  color: var(--primary);
  border: none;
  padding: 16px 36px;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.magic-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.28);
}

.magic-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.magic-footer {
  margin-top: 16px;
  font-size: 0.85rem;
  opacity: 0.85;
  font-weight: 500;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 28px 0 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span { padding: 0 16px; }

/* ===== SOCIAL GRID ===== */
.social-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .social-grid { grid-template-columns: 1fr; }
}

.social-card { margin-bottom: 0; }

.social-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.social-input-row input[type="text"] {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}

.social-max {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.social-max label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.social-max input[type="number"] {
  width: 68px;
  padding: 9px 8px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

/* ===== YOUTUBE ===== */
.youtube-card {
  border: 2px solid #ff000022;
  background: linear-gradient(135deg, #fff5f5, #ffffff);
  margin-bottom: 20px;
}

.badge-new {
  background: #ff0000;
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  margin-left: auto;
}

.youtube-card .social-input-row input[type="text"]:focus { border-color: #ff0000; }
.youtube-card .social-max input[type="number"]:focus { border-color: #ff0000; }

.youtube-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fff5f5;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #cc0000;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid #ffcccc;
  border-top-color: #ff0000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

.btn-youtube {
  background: #ff0000;
  color: white;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.btn-youtube:hover:not(:disabled) { background: #cc0000; transform: translateY(-1px); }
.btn-youtube:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== FACEBOOK ===== */
.facebook-card {
  border: 2px solid #1877f222;
  background: linear-gradient(135deg, #f0f4ff, #ffffff);
}

.facebook-card .social-input-row input[type="text"]:focus { border-color: #1877f2; }
.facebook-card .social-max input[type="number"]:focus { border-color: #1877f2; }

.facebook-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #e8f0fe;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1877f2;
}

.spinner-blue {
  border: 3px solid #c0d4fb;
  border-top-color: #1877f2;
}

.btn-facebook {
  background: #1877f2;
  color: white;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.btn-facebook:hover:not(:disabled) { background: #1558b0; transform: translateY(-1px); }
.btn-facebook:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== INSTAGRAM ===== */
.instagram-card {
  border: 2px solid #e104764a;
  background: linear-gradient(135deg, #fff0f8, #ffffff);
}

.instagram-card .social-input-row input[type="text"]:focus { border-color: #e10476; }
.instagram-card .social-max input[type="number"]:focus { border-color: #e10476; }

.badge-auth {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  background: #fee2e2;
  color: #dc2626;
}
.badge-auth.connected {
  background: #dcfce7;
  color: #16a34a;
}

.instagram-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fce7f3;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #e10476;
}

.spinner-ig {
  border: 3px solid #fbc8e6;
  border-top-color: #e10476;
}

.btn-instagram {
  background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: white;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.btn-instagram:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.btn-instagram:disabled { opacity: 0.5; cursor: not-allowed; }

.ig-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #fce7f3;
  border-radius: 8px;
  margin-bottom: 12px;
}

.ig-user-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #be185d;
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  text-decoration: underline;
}

/* ===== PANNEAU META (Facebook + Instagram) ===== */
.meta-panel {
  margin-bottom: 20px;
}

.owner-link-row {
  margin-top: 12px;
  text-align: center;
}

.meta-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f0f4ff;
  border-radius: 10px;
  margin-bottom: 16px;
}

.meta-user-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: #1877f2;
}

.meta-platform-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.meta-tab {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--border);
  background: white;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
}

.meta-tab.active {
  border-color: var(--primary);
  background: var(--secondary);
  color: var(--primary);
}

.meta-select-row {
  margin-bottom: 18px;
}

.meta-select-row label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.meta-select-row select {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  background: white;
}

.meta-select-row select:focus { border-color: var(--primary); }

.meta-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.meta-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.post-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(108,99,255,0.18);
}

.post-card-img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: linear-gradient(135deg, #e0e7ff, #f3e8ff);
}

.post-card-noimg {
  width: 100%;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: linear-gradient(135deg, #e0e7ff, #f3e8ff);
}

.post-card-body {
  padding: 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.post-card-text {
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.post-card-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.post-card-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--secondary);
  padding: 2px 8px;
  border-radius: 20px;
}

.meta-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 14px;
  text-align: center;
}

.meta-showmore-wrap {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.meta-showmore-wrap .btn {
  width: 100%;
  justify-content: center;
}

/* ===== TIKTOK ===== */
.tiktok-card {
  border: 2px solid #00000022;
  background: linear-gradient(135deg, #f5f5f5, #ffffff);
}

.tiktok-card .social-input-row input[type="text"]:focus { border-color: #010101; }
.tiktok-card .social-max input[type="number"]:focus { border-color: #010101; }

.tiktok-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f0f0f0;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #010101;
}

.spinner-tt {
  border: 3px solid #cccccc;
  border-top-color: #010101;
}

.btn-tiktok {
  background: linear-gradient(135deg, #010101, #333333);
  color: white;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  position: relative;
  overflow: hidden;
}
.btn-tiktok::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #fe2c5525, #25f4ee25);
  opacity: 0;
  transition: opacity 0.2s;
}
.btn-tiktok:hover:not(:disabled)::before { opacity: 1; }
.btn-tiktok:hover:not(:disabled) { transform: translateY(-1px); }
.btn-tiktok:disabled { opacity: 0.5; cursor: not-allowed; }

.tt-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f0f0f0;
  border-radius: 8px;
  margin-bottom: 12px;
}

.tt-user-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #010101;
}

/* ===== HISTORIQUE ===== */
.history-item {
  background: white;
  border-radius: var(--radius);
  padding: 20px 24px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.history-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.history-badge {
  background: var(--secondary);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}

.history-winners {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-winner-tag {
  background: #fef9e7;
  border: 1px solid #fbbf24;
  color: #92400e;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: white;
  border-radius: 24px;
  padding: 48px 40px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
  from { transform: translateY(40px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.winner-crown { font-size: 4rem; margin-bottom: 8px; }
.winner-title { font-size: 1.8rem; font-weight: 800; margin-bottom: 16px; color: var(--text); }

.winner-names {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.winner-name-item {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  padding: 10px 24px;
  background: var(--secondary);
  border-radius: 12px;
}

.winner-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 8px; }

.winner-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.modal-actions { display: flex; gap: 12px; justify-content: center; }

/* ===== CONFETTI ===== */
.confetti-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  to { transform: translateY(600px) rotate(720deg); opacity: 0; }
}

/* ===== PIED DE PAGE ===== */
.site-footer {
  margin-top: 48px;
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: white;
  padding: 40px 24px 20px;
}

.footer-grid {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.footer-brand-icon { font-size: 1.8rem; }

.footer-brand-name {
  font-size: 1.25rem;
  font-weight: 800;
}

.footer-dev-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.6;
  margin-bottom: 4px;
}

.footer-dev-name {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.footer-col-dev {
  text-align: right;
}

.footer-col-dev .footer-socials {
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .footer-col-dev { text-align: left; }
  .footer-col-dev .footer-socials { justify-content: flex-start; }
}

.footer-text {
  font-size: 0.88rem;
  opacity: 0.75;
  line-height: 1.6;
  margin-bottom: 16px;
}

.footer-socials {
  display: flex;
  gap: 10px;
}

.footer-social {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  text-decoration: none;
  transition: all 0.2s;
}

.footer-social:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-3px);
}

.footer-bottom {
  max-width: 960px;
  margin: 28px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.15);
  text-align: center;
  font-size: 0.82rem;
  opacity: 0.6;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 22px;
  background: #1e1b4b;
  color: white;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  z-index: 2000;
  pointer-events: none;
  max-width: 320px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}
