:root {
    --primary: #6750A4;
    --on-primary: #ffffff;
    --surface: #ffffff;
    --bg: #f7f7f9;
    --border: #e0e0e0;
    --text: #1a1a1a;
    --muted: #666666;
    --success: #1b6b2e;
    --error: #b3261e;
    --radius: 12px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

button, a, input, .btn {
    touch-action: manipulation;
}

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.page {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}

h1 { font-size: 1.4rem; margin: 0 0 4px; }
h2 { font-size: 1.1rem; margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 0.9rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 10px;
}

.btn {
    display: inline-block;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--primary);
    color: var(--on-primary);
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn--outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn--danger { background: var(--error); }
.btn--block { width: 100%; }
.btn--sm { padding: 6px 10px; font-size: 0.85rem; }

.row { display: flex; gap: 8px; align-items: center; }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--border);
}
.badge--live { background: #fff3cd; color: #7a5b00; }

.error-box {
    background: #fdecea;
    color: var(--error);
    border: 1px solid #f5c6c3;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

/* File d'attente pour la parole — 1er = à la parole (mis en évidence),
   même convention visuelle que l'ordre de buzz du buzzer. */
.queue-list { list-style: none; margin: 0; padding: 0; }
.queue-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}
.queue-list li:first-child { font-weight: 700; background: #fff3cd; }

/* Salon list (page d'accueil) */
.salon-list { list-style: none; margin: 0; padding: 0; }
.salon-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.salon-list__title { font-weight: 600; }
.salon-list__actions { display: flex; gap: 6px; }

/* Une "personne" gérée par cet appareil (voir project note : un même
   téléphone peut représenter plusieurs personnes). */
.person-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.person-row__name { font-weight: 600; }
.person-row__status { font-size: 0.8rem; color: var(--muted); }
.person-row__status--speaking { color: var(--success); font-weight: 700; }
.person-row__actions { display: flex; gap: 6px; margin-left: auto; }

.people-list { list-style: none; margin: 0 0 10px; padding: 0; }

/* Liste des personnes côté animateur·ice (Joueurs connectés-like) */
.person-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
}
.person-dot--offline { background: var(--border); }
