/* Charte graphique reprise de BourgsEtBled : thème sombre par défaut, thème clair au choix (Paramètres). */
:root {
    --bg: #12172b;
    --bg2: #1b2240;
    --panel: #232b4d;
    --text: #eef1fb;
    --muted: #9aa3c4;
    --accent: #4f7cff;
    --danger: #ff6b6b;
    --success: #22a55a;

    /* Éléments d'interface (redéfinis pour le thème clair) */
    --topbar-bg: rgba(18, 23, 43, 0.94);
    --line: rgba(255, 255, 255, 0.08);
    --hover: rgba(255, 255, 255, 0.06);
    --field-border: rgba(255, 255, 255, 0.18);
    --danger-bg: rgba(255, 107, 107, 0.08);

    /* Or de la marque et du podium */
    --shadow: 0 4px 14px rgba(0, 0, 0, 0.3);   /* ombre unique et discrète des photos */
    --gold: #ffcc00;
    --gold-l: #fff59d;
    --gold-d: #b8860b;
    --silver: #b0b7c3;
    --bronze: #cd7f32;
}

:root[data-theme="light"] {
    --bg: #eef1f8;
    --bg2: #ffffff;
    --panel: #ffffff;
    --text: #1d2333;
    --muted: #5d6680;
    --accent: #3461e8;
    --danger: #d93a3a;
    --topbar-bg: rgba(255, 255, 255, 0.94);
    --line: rgba(20, 30, 60, 0.1);
    --hover: rgba(20, 30, 60, 0.06);
    --field-border: rgba(20, 30, 60, 0.2);
    --danger-bg: rgba(217, 58, 58, 0.06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    background: radial-gradient(ellipse at top, var(--bg2), var(--bg) 70%) fixed;
    color: var(--text);
}

[hidden] { display: none !important; }

/* Navigation au clavier : un seul style de focus, net et cohérent */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2 { margin: 0 0 0.4em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.error { color: var(--danger); min-height: 1.2em; margin: 0.3em 0; }
.status { margin: 0 0 16px; text-align: center; }
.status:empty { display: none; }
.status.error { min-height: 0; }
.loading { text-align: center; }

/* ---------- Barre du haut ---------- */

/* Barre du haut sur PC : titre à gauche, onglets du jeu centrés, menu ⋯ à droite */
.topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    padding: 10px 24px;
    background: var(--topbar-bg);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
}

.brand { grid-column: 1; justify-self: start; font-weight: 800; font-size: 1.2rem; letter-spacing: 0.5px; white-space: nowrap; }
.brand-text span { color: var(--gold); }
a.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; border-radius: 6px; }
.brand-icon { display: block; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 7px; }
a.brand:hover { opacity: 0.85; }
:root[data-theme="light"] .brand-text span { color: #c79600; }

/* ---------- Menu « ⋯ » (Paramètres, Admin) ---------- */

.account {
    grid-column: 3;
    justify-self: end;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}


.icon-btn {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    background: none;
    color: var(--muted);
    transition: color 0.2s, background 0.2s;
}

.icon-btn:hover,
.icon-btn.active,
.icon-btn[aria-expanded="true"] { color: var(--text); background: var(--panel); }

.account-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 950;
    min-width: 200px;
    padding: 6px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    animation: menu-in 0.15s ease-out;
}

.account-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.account-menu button:hover,
.account-menu button:focus-visible { background: var(--hover); outline: none; }

.menu-icon,
.tab-icon,
.btn-icon {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.menu-icon { width: 18px; height: 18px; color: var(--muted); }

@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Mise en page ---------- */

/* Pleine largeur (plafonnée à 1 400 px sur très grand écran, comme BourgsEtBled) */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 24px 48px;
}

.card {
    background: var(--panel);
    border-radius: 16px;
    padding: clamp(18px, 3vw, 36px);
    margin-bottom: 20px;
}

/* Écrans de lecture (Paramètres) : colonne confortable, centrée */
.settings { max-width: 720px; margin-left: auto; margin-right: auto; }

/* ---------- Onglets ---------- */

.tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.tabs button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.tabs button:hover { color: var(--text); background: var(--hover); }
.tabs button[aria-selected="true"] { color: var(--text); background: var(--panel); }

.game-tabs { grid-column: 2; justify-content: center; flex-wrap: nowrap; margin: 0; }
.game-tabs .tab-icon { display: block; width: 20px; height: 20px; flex: 0 0 auto; }
.game-tabs button[aria-selected="true"] .tab-icon { color: var(--gold); }
:root[data-theme="light"] .game-tabs button[aria-selected="true"] .tab-icon { color: var(--accent); }

/* ---------- Boutons et formulaires ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, filter 0.2s;
}

.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; transform: none; }
.btn-ghost { background: transparent; border: 1px solid var(--accent); color: var(--text); }
.btn-danger { background: #d93a3a; }
.btn-block { width: 100%; }

.btn-big {
    padding: 14px 28px;
    font-size: 1.05rem;
    background: var(--gold);
    color: #1b1300;
}

.btn-big.btn-ghost { background: transparent; border: 1px solid var(--gold); color: var(--text); }
.btn-icon { width: 22px; height: 22px; }

.link {
    padding: 4px 0;
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.link:hover { color: var(--text); }

input,
select,
textarea {
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--field-border);
    border-radius: 8px;
    padding: 10px;
}

.field {
    display: block;
    margin-bottom: 14px;
    font-weight: 600;
}

.field input,
.field select {
    display: block;
    width: 100%;
    margin-top: 4px;
    font-weight: 400;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* ---------- Connexion ---------- */

.auth-box { max-width: 480px; margin: 6vh auto 0; }
.auth-title { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 2.2rem; font-weight: 900; letter-spacing: 0.5px; }


.auth-icon { display: block; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 11px; }
.auth-tagline { margin: 4px 0 8px; font-size: 1.15rem; font-weight: 600; }
.auth-panel { margin-top: 22px; }
.auth-panel h2 { margin: 0 0 14px; font-size: 1.25rem; }
.auth-switch { margin: 16px 0 0; text-align: center; font-size: 0.9rem; color: var(--muted); }
.auth-switch .link { font-size: inherit; color: var(--accent); }
.field-hint { font-weight: 400; font-size: 0.8rem; }
.forgot-link { display: block; margin: -10px 0 4px auto; font-size: 0.9rem; }

/* Inscription : case des conditions (le bouton « Créer mon compte » reste grisé tant qu'elle n'est pas cochée) */
.checkbox-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 14px;
    font-size: 0.9rem;
    line-height: 1.4;
    cursor: pointer;
}
.checkbox-line input { width: 18px; height: 18px; margin: 1px 0 0; flex: 0 0 18px; accent-color: var(--accent); }
.checkbox-line a { color: var(--accent); }

/* ---------- Mot affiché en grand, centré ---------- */

.word-head {
    text-align: center;
    margin-bottom: 80px;   /* espace franc entre le mot / compte à rebours et les photos */
}

.word-label {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
}

/* Or uni (sobre), interligne confortable : aucune lettre descendante (g, j, p, q) n'est coupée */
.word-big {
    margin: 4px 0 14px;
    font-size: clamp(2.6rem, 12vw, 5rem);
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0.3px;
    overflow-wrap: anywhere;
    color: var(--gold);
}

:root[data-theme="light"] .word-big { color: #a37800; }

.countdown { margin: 0; color: var(--muted); }
.countdown strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Pictos posés sur les photos ---------- */

.photo-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
}

.photo-btn {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(10, 14, 30, 0.6);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s, background 0.2s, color 0.2s;
}

.photo-btn svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.photo-btn:hover { transform: scale(1.1); background: rgba(10, 14, 30, 0.8); }
.photo-btn:active { transform: scale(0.92); }
.photo-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.photo-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.photo-btn-danger:hover { background: #d93a3a; }

/* ---------- Mot du jour : photo envoyée et boutons d'envoi ---------- */

/* La photo garde ses proportions réelles (jamais recadrée) ; le cadre épouse la photo pour que les boutons restent dessus */
.my-photo {
    position: relative;
    width: fit-content;
    margin: 0 auto;
    max-width: min(100%, 900px);
}

.my-photo img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 70vh;
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.send-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.send-actions .btn { width: min(100%, 360px); }

.send-invite { margin: 0 0 6px; text-align: center; color: var(--text); }

/* Envois restants pour le mot du jour */
.upload-counter {
    margin: 14px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.875rem;
}

.upload-counter.exhausted { color: var(--danger); }

/* « Prendre une photo » : seulement sur les appareils tactiles (téléphones, tablettes) */
.camera-only { display: none !important; }

@media (pointer: coarse) {
    .camera-only:not([hidden]) { display: inline-flex !important; }
}

img.zoomable { cursor: zoom-in; }

/* ---------- Vote du jour ---------- */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: clamp(12px, 2vw, 28px);
}

.vote-card { margin: 0; }

.photo-frame { position: relative; }

.photo-frame img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;          /* photo entière, réduite et centrée dans le cadre (jamais recadrée) */
    background: var(--bg);
    border-radius: 14px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}

.vote-card.chosen .photo-frame img { box-shadow: 0 0 0 3px var(--success), var(--shadow); }

/* Pictos du vote, en grille comme en pile : Signaler en haut à gauche, Voter (plus grand) en haut à droite */
.photo-frame .report-btn { position: absolute; top: 10px; left: 10px; }
.photo-frame .vote-btn { position: absolute; top: 10px; right: 10px; width: 54px; height: 54px; }
.photo-frame .vote-btn svg { width: 30px; height: 30px; }

/* Coche de vote : neutre (cliquer pour voter pour cette photo), verte sur la photo votée (cliquer pour retirer le vote) */
.vote-btn.voted { background: var(--success); color: #fff; }
.vote-btn.voted:hover { background: #1b8a4a; }
.vote-btn:not(.voted):hover { background: var(--success); }

/* Choix de l'affichage du vote : grille ou photo par photo */
.view-switch {
    display: flex;
    width: max-content;
    max-width: 100%;
    gap: 4px;
    margin: 0 auto 28px;
    padding: 4px;
    border-radius: 12px;
    background: var(--bg);
}

.view-switch button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.1s;
}

.view-switch button:active { transform: scale(0.95); }
.view-switch button.selected { background: var(--panel); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }
.view-switch .btn-icon { width: 18px; height: 18px; }

/* Pile de photos (mode « Photo ») : la photo du haut se fait glisser, les suivantes dépassent derrière */
.vote-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.stack-area {
    position: relative;
    width: min(100%, 560px);
    aspect-ratio: 4 / 5;
    margin-bottom: 16px;
}

.stack-card {
    position: absolute;
    inset: 0;
    margin: 0;
    overflow: hidden;
    border-radius: 18px;
    background: var(--bg);
    box-shadow: var(--shadow);
    transition: transform 0.26s ease, opacity 0.26s ease;
    user-select: none;
    -webkit-user-select: none;
}

.stack-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;          /* photo entière, réduite et centrée */
    -webkit-user-drag: none;
}

.stack-back { pointer-events: none; }
.stack-back.depth-1 { transform: translateY(14px) scale(0.95) rotate(-3deg); opacity: 0.85; }
.stack-back.depth-2 { transform: translateY(26px) scale(0.9) rotate(4deg); opacity: 0.6; }

.stack-top { touch-action: pan-y; cursor: grab; }
.stack-top.dragging { transition: none; cursor: grabbing; }
.stack-top.leaving { pointer-events: none; }
.stack-top.enter { animation: stack-in 0.28s ease-out; }
.stack-top.chosen { box-shadow: 0 0 0 4px var(--success), var(--shadow); }
.stack-top .photo-frame { position: absolute; inset: 0; }
.stack-top .photo-frame img { aspect-ratio: auto; height: 100%; border-radius: 0; box-shadow: none; }

.stack-nav { display: flex; align-items: center; gap: 20px; }
.stack-arrow { background: var(--bg); color: var(--text); }
.stack-arrow:hover { background: var(--accent); }
.stack-count { min-width: 64px; text-align: center; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

@keyframes stack-in {
    from { transform: translateY(14px) scale(0.95) rotate(-3deg); opacity: 0.85; }
}

/* ---------- Résultats : podium ---------- */

.podium {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    align-items: end;
    gap: clamp(10px, 2.5vw, 32px);
    max-width: 1100px;
    margin: 0 auto;
}

.podium-column {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-width: 0;
}

.podium-winners {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 10px;
    text-align: center;
}

.podium-entry { margin: 0; }

.podium-entry img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;          /* photo entière, réduite et centrée */
    background: var(--bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.podium-entry p { margin: 0; }
.podium-entry img + p { margin-top: 6px; }
/* Photo du joueur sur le podium : seul repère, un contour jaune (les auteurs restent anonymes) */
.podium-entry img.podium-mine { box-shadow: 0 0 0 3px var(--gold), var(--shadow); }
:root[data-theme="light"] .podium-entry img.podium-mine { box-shadow: 0 0 0 3px #c79600, var(--shadow); }

.podium-step {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px 10px 0 0;
    color: #1b1300;
    font-weight: 900;
    text-align: center;
}

.rank-1 .podium-step { height: 104px; background: var(--gold); font-size: 1.3rem; }
.rank-2 .podium-step { height: 74px; background: var(--silver); }
.rank-3 .podium-step { height: 52px; background: var(--bronze); }

/* ---------- Photo agrandie : image seule, sans cadre ---------- */

.lightbox {
    max-width: 100vw;
    max-height: 100vh;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
}

.lightbox::backdrop { background: rgba(5, 8, 20, 0.88); }

.lightbox img {
    display: block;
    max-width: 94vw;
    max-height: 90vh;
    border-radius: 8px;
    animation: zoom-in 0.2s ease-out;
}

.lightbox-close {
    position: fixed;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
}

.lightbox-close svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.24); }

@keyframes zoom-in { from { opacity: 0; transform: scale(0.92); } }

/* ---------- Fenêtre modale (confirmations, messages) ---------- */

.modal {
    width: min(440px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal::backdrop { background: rgba(5, 8, 20, 0.75); }
.modal[open] { animation: zoom-in 0.18s ease-out; }

.modal-box { padding: 24px; }
.modal-box h2 { margin: 0 0 10px; font-size: 1.25rem; }
.modal-box p { margin: 0 0 16px; }

.modal-box textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    resize: vertical;
    font-weight: 400;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

#vote-pagination { margin-top: 24px; }

/* ---------- Paramètres ---------- */

.settings h2 { margin-top: 0; }

.settings-info {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 16px;
    margin: 8px 0 0;
}

.settings-info dt { color: var(--muted); }
.settings-info dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.settings-block {
    border-top: 1px solid var(--line);
    margin-top: 22px;
    padding-top: 6px;
}

.settings-block h3 { margin: 14px 0 8px; font-size: 1.05rem; }

.inline-field { display: flex; gap: 8px; }
.inline-field input { flex: 1; min-width: 0; }

.form-message { margin: 8px 0; color: #6ee7a8; }
.form-message:empty { display: none; }
.form-message.error { color: var(--danger); }
:root[data-theme="light"] .form-message:not(.error) { color: #1f7a4d; }

.setting-label { margin: 10px 0 6px; color: var(--muted); font-size: 0.875rem; font-weight: 600; }

.theme-switch {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: var(--bg);
}

.theme-switch button {
    padding: 8px 16px;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.theme-switch button.selected { background: var(--panel); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }

.danger-zone {
    background: var(--danger-bg);
    border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
    border-radius: 12px;
    padding: 4px 16px 16px;
}

.danger-zone h3 { color: var(--danger); }

/* ---------- Administration ---------- */

/* Onglets de l'Admin (et sous-onglets des e-mails), repris de BourgsEtBled */
.admin-box h2 { margin-top: 0; }

.admin-tabs {
    display: flex;
    gap: 4px;
    margin: 6px 0 18px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
}

.admin-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 10px 14px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: none;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.admin-tabs button:hover { color: var(--text); }
.admin-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.mail-tabs { margin: 12px 0 0; }
.mail-tabs button { padding: 8px 12px; font-size: 0.9rem; }

/* Pastilles : nombre de signalements à traiter (onglet, menu) et point rouge sur le bouton ⋯ */
.count-badge {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 99px;
    background: #ff3d6e;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

.dot-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 1;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ff3d6e;
    box-shadow: 0 0 0 2px var(--bg);
    pointer-events: none;
}

/* Listes de joueurs et de photos signalées */
.admin-list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }

.admin-player {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--bg);
}

.admin-player.report-open { border-left: 4px solid #ff3d6e; }
.admin-player-info { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.admin-player-info .muted { overflow-wrap: anywhere; font-size: 0.9rem; }
.admin-player-meta { font-size: 0.78rem; color: var(--muted); }
.admin-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.admin-tag { padding: 2px 8px; border-radius: 99px; background: var(--panel); font-size: 0.72rem; font-weight: 700; }
.tag-admin { color: var(--gold); }
.tag-me { color: var(--accent); }
.tag-ban { color: var(--danger); }
.tag-warn { color: #ff9800; }
.admin-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 360px; }
.btn-small { padding: 6px 12px; font-size: 0.85rem; }
.btn-warn { background: #c26a00; }

.admin-report > img,
.report-thumb-empty {
    flex: 0 0 140px;
    width: 140px;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: var(--bg);
    border-radius: 8px;
}

.report-thumb-empty { display: grid; place-items: center; background: var(--panel); }
.report-list { margin: 8px 0 0; padding-left: 18px; font-size: 0.85rem; }
.report-list li { margin: 3px 0; }
.report-list q { display: block; color: var(--muted); }
.report-list .report-dismissed,
.report-list .report-resolved { color: var(--muted); }

.check { display: flex; align-items: center; gap: 8px; margin: 10px 0; cursor: pointer; }

.admin-template { margin-top: 14px; }
.admin-template h3 { margin: 0 0 8px; }
.admin-template input,
.admin-template textarea { display: block; width: 100%; margin-top: 4px; font-weight: 400; }
.admin-template textarea { resize: vertical; }

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0 12px;
}

.table-wrap { overflow-x: auto; }

.words-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.words-table th,
.words-table td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.words-table th { color: var(--muted); font-weight: 600; }
.words-table td:last-child { text-align: right; }
.words-table .word-cell { font-weight: 700; }
.words-table .excluded { color: var(--danger); }

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 14px;
}

@media (max-width: 640px) {
    .admin-player { flex-direction: column; }
    .admin-actions { justify-content: flex-start; max-width: none; }
    .admin-report > img,
    .report-thumb-empty { width: 100%; flex-basis: auto; }
}

/* ---------- Pied de page, pages légales et contact (repris de BourgsEtBled) ---------- */

.site-footer {
    max-width: 1400px;
    margin: 0 auto;
    padding: 18px 24px 26px;
    border-top: 1px solid var(--line);
    text-align: center;
}

.site-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 22px; }
.site-footer a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.site-footer a:hover,
.site-footer a[aria-current="page"] { color: var(--text); text-decoration: underline; }
.site-footer p { margin: 10px 0 0; font-size: 0.8rem; }

.legal-box a { color: var(--accent); }

.legal-page { max-width: 860px; }
.back-link { color: var(--muted); text-decoration: none; font-weight: 600; }
.back-link:hover { color: var(--text); }
.legal-box { line-height: 1.65; }
.legal-box h1 { margin: 0 0 4px; }
.legal-date { margin: 0 0 18px; font-size: 0.85rem; }
.legal-box h2 { margin: 28px 0 8px; font-size: 1.15rem; }
.legal-box ul { padding-left: 22px; }
.legal-box li { margin: 5px 0; }
mark.todo { background: rgba(255, 204, 0, 0.2); color: inherit; border: 1px dashed var(--gold); border-radius: 4px; padding: 0 4px; }

.contact-form textarea {
    display: block;
    width: 100%;
    margin-top: 4px;
    min-height: 140px;
    resize: vertical;
    font-weight: 400;
}

/* Compteur sous le message : orange tant que le minimum n'est pas atteint, vert ensuite */
.contact-counter { margin: -6px 0 12px; font-size: 0.82rem; font-weight: 600; color: #ff9800; text-align: right; }
.contact-counter.ok { color: var(--success); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Animations des actions du joueur ---------- */

/* Changement d'onglet : le contenu glisse, le mot « éclot », l'icône de l'onglet choisi rebondit */
[data-panel]:not([hidden]) { animation: panel-in 0.32s ease-out; }
.word-big { animation: word-in 0.45s ease-out; }
.tabs button { transition: background 0.2s, color 0.2s, transform 0.1s; }
.tabs button:active { transform: scale(0.95); }

/* Photos : apparition en cascade (page ou mode d'affichage changé), effacement à la suppression */
.vote-card.cascade { animation: card-in 0.4s ease-out both; animation-delay: calc(var(--i, 0) * 45ms); }
.my-photo:not([hidden]) { animation: card-in 0.4s ease-out; }
/* Suppression : la photo se désagrège en fragments (créés par disintegrate() dans game.js) */
.dust-layer { position: fixed; z-index: 800; pointer-events: none; }
.dust-base { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 14px; }
.dust { position: absolute; opacity: 0; background-repeat: no-repeat; will-change: transform, opacity; }
.send-actions:not([hidden]) .btn { animation: card-in 0.35s ease-out both; }
.send-actions:not([hidden]) .btn + .btn { animation-delay: 0.08s; }

/* Vote : la coche verte éclot avec un halo */
.vote-btn.pop { animation: vote-pop 0.55s ease-out; }

/* Analyse et envoi d'une photo : indicateur qui tourne */
.status.busy::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    vertical-align: -2px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* Podium : les marches montent, puis les gagnants apparaissent (3e, 2e, puis 1er) */
.podium-step { transform-origin: bottom; animation: step-grow 0.6s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.podium-winners { animation: card-in 0.45s ease-out both; }
.rank-3 .podium-step { animation-delay: 0.05s; }
.rank-2 .podium-step { animation-delay: 0.15s; }
.rank-1 .podium-step { animation-delay: 0.25s; }
.rank-3 .podium-winners { animation-delay: 0.45s; }
.rank-2 .podium-winners { animation-delay: 0.6s; }
.rank-1 .podium-winners { animation-delay: 0.75s; }

@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes word-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes step-grow { from { transform: scaleY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes vote-pop {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34, 165, 90, 0.6); }
    40% { transform: scale(1.4); box-shadow: 0 0 0 10px rgba(34, 165, 90, 0.25); }
    100% { transform: scale(1); box-shadow: 0 0 0 16px rgba(34, 165, 90, 0); }
}

/* « Animations : Réduites » (Paramètres → Apparence) : animations quasi instantanées, aucune transition.
   Choix du joueur ; par défaut les animations sont actives, même si le système demande de les réduire. */
:root[data-motion="reduced"] *,
:root[data-motion="reduced"] *::before,
:root[data-motion="reduced"] *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition: none !important;   /* aucune transition (une durée infime transitionnerait toutes les propriétés) */
}

/* ---------- Mobile : barre d'onglets fixée en bas, comme une application ---------- */

/* Écrans intermédiaires : on garde les onglets lisibles dans la barre du haut */
@media (min-width: 641px) and (max-width: 960px) {
    .game-tabs button { padding: 8px 10px; }
}

@media (max-width: 640px) {
    /* backdrop-filter créerait un repère pour les éléments fixed : fond plein à la place */
    .topbar { padding: 10px 16px; backdrop-filter: none; background: var(--bg); }

    .container { padding: 12px 12px 16px; }
    /* Le pied de page (dernier élément) reste visible au-dessus de la barre d'onglets du bas */
    .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
    .card { padding: 18px 12px; }
    .word-head { margin-bottom: 56px; }
    .modal-actions .btn { flex: 1 1 auto; }

    .game-tabs {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 900;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0;
        margin: 0;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
        background: var(--topbar-bg);
        backdrop-filter: blur(8px);
        border-top: 1px solid var(--line);
        box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.35);
    }

    .game-tabs button {
        flex-direction: column;
        gap: 3px;
        padding: 6px 2px;
        border-radius: 10px;
        font-size: 0.7rem;
    }

    .game-tabs .tab-icon { display: block; width: 24px; height: 24px; }
    .game-tabs button[aria-selected="true"] { background: none; color: var(--gold); }
    :root[data-theme="light"] .game-tabs button[aria-selected="true"] { color: var(--accent); }
    .game-tabs button:hover { background: none; }

    .photo-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}
