* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(160deg, #14532d, #166534 45%, #0f3d22);
  color: #1f2937;
  overflow-x: hidden;
}

.wrap { max-width: 680px; margin: 0 auto; padding: 24px 16px 64px; }

h1 { font-size: 1.5rem; margin: 0 0 8px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 20px 0 8px; }

.card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  margin-top: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.muted { color: #6b7280; }
.small { font-size: 0.85rem; }
.error { color: #b91c1c; font-weight: 600; }
.hidden { display: none !important; }

/* Formulaire */
form label { display: block; font-weight: 600; margin: 12px 0 4px; }
form input[type="text"], form input[type="email"], form input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 1rem;
  background: #f9fafb;
}
form input:focus { outline: 2px solid #1f7a4d; outline-offset: 1px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.checkbox input { width: 18px; height: 18px; }

/* Boutons */
button {
  font: inherit;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
}
button:disabled { opacity: 0.6; cursor: wait; }
.primary { background: #1f7a4d; color: #fff; }
.primary:hover { background: #17603c; }
.danger { background: #fee2e2; color: #b91c1c; }
.danger:hover { background: #fecaca; }
.ghost { background: #f3f4f6; color: #374151; }
.ghost:hover { background: #e5e7eb; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* En-tête connecté */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: #fff; flex-wrap: wrap; }
.session { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.session .ghost { padding: 6px 10px; font-size: 0.85rem; }

/* Le pigeon */
.receiver {
  font-size: 2rem;
  font-weight: 800;
  margin: 8px 0 12px;
  color: #1f7a4d;
  overflow-wrap: anywhere;
}
.receiver.blurred {
  filter: blur(10px);
  user-select: none;
  cursor: pointer;
}

/* Table des participants */
table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
th { text-align: left; font-size: 0.8rem; text-transform: uppercase; color: #6b7280; padding: 6px 4px; }
td { padding: 8px 4px; border-top: 1px solid #f3f4f6; vertical-align: middle; font-size: 0.95rem; }
td button { padding: 5px 10px; font-size: 0.8rem; }
.cell-email { color: #6b7280; word-break: break-word; }
.row-actions { white-space: nowrap; }
.row-actions button { margin-left: 6px; }
.row-actions button:first-child { margin-left: 0; }
.badge {
  background: #dcfce7;
  color: #166534;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

/* ----- Mobile : tout tient sans débordement ----- */
@media (max-width: 640px) {
  .wrap { padding: 16px 10px 48px; }
  .card { padding: 16px 14px; border-radius: 14px; margin-top: 12px; }
  h1 { font-size: 1.25rem; }
  h2 { font-size: 1.05rem; }
  .receiver { font-size: 1.6rem; }
  .topbar h1 { flex: 1; }

  /* La table devient des cartes empilées */
  #participants-table, #participants-table tbody { display: block; }
  #participants-table thead { display: none; }
  #participants-table tr {
    display: block;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 12px;
    margin: 10px 0;
  }
  #participants-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-top: none;
    padding: 5px 0;
    font-size: 0.9rem;
  }
  #participants-table td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
    flex-shrink: 0;
  }
  #participants-table td.row-actions::before { content: none; }
  #participants-table td.row-actions {
    justify-content: flex-end;
    padding-top: 8px;
  }
  .row { gap: 8px; }
  .row button { flex: 1; }
}
