﻿/* Flexi Solutions : feuille de styles commune des webapps (charte Flexi Keys du 16/10/2026, reprise telle quelle pour Flexi Play). */
:root { --bg: #f5f6f8; --card: #fff; --text: #1b1f24; --muted: #5d6673; --border: #dde1e6; --placeholder: #a3abb5;
        --open: #1f7a4d; --close: #1d4f91; --ok-bg: #e6f4ec; --ok: #1f6b45; --err-bg: #fbeaea; --err: #a32020;
        --warn-bg: #fdf3e1; --warn: #8a5a00; --accent: #1d4f91; --row: #f8f9fb; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #111418; --card: #1b2026; --text: #eef1f4; --muted: #9aa4b1; --border: #2c333b; --placeholder: #66707c;
          --open: #2f9e66; --close: #3a74c4; --ok-bg: #173325; --ok: #7fd3a6; --err-bg: #3a1b1b; --err: #f08a8a;
          --warn-bg: #3a2e14; --warn: #f0c46a; --accent: #6ea0e6; --row: #20262d; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 440px; margin: 0 auto; padding: 24px 16px 40px; }
main.wide { max-width: 1080px; font-size: 15.5px; }
main.legal-page { max-width: 760px; }
a { color: var(--accent); }
h1 { font-size: 1.35rem; margin: 0 0 4px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
.muted { color: var(--muted); font-size: .95rem; margin: 0; }
.note { margin-top: 18px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.card + .card { margin-top: 16px; }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.inline { display: inline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Messages et bandeaux */
.msg { border-radius: 10px; padding: 12px 14px; margin: 14px 0; font-size: .97rem; }
.msg.ok { background: var(--ok-bg); }
.msg.error { background: var(--err-bg); color: var(--err); }
.msg.warn { background: var(--warn-bg); color: var(--warn); }
.billing-bar { text-align: center; padding: 9px 16px; font-size: .92rem; border-bottom: 1px solid var(--border); }
.billing-bar.soon { background: var(--warn-bg); color: var(--warn); }
.billing-bar.due { background: var(--err-bg); color: var(--err); font-weight: 600; }
.billing-bar a { color: inherit; font-weight: 600; margin-left: 6px; }
.demo-bar { background: #fff4d6; color: #5c4400; border-bottom: 1px solid #f0d890; text-align: center; padding: 8px 16px; font-size: .9rem; }
.demo-bar a { color: inherit; font-weight: 600; margin-left: 6px; }

/* Boutons */
.btn { display: inline-block; border: 1px solid var(--border); background: var(--card); color: var(--text);
       border-radius: 9px; padding: 8px 14px; font: inherit; font-size: .95rem; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--err); }
.btn.block { display: block; width: 100%; text-align: center; padding: 11px 14px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 10px; }
.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--muted); font: inherit; cursor: pointer; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.actions { display: grid; gap: 14px; margin-top: 22px; }
.actions button { width: 100%; border: 0; border-radius: 12px; padding: 22px 16px; font: inherit;
                  font-size: 1.2rem; font-weight: 600; color: #fff; cursor: pointer; }
button.open { background: var(--open); }
button.close { background: var(--close); }
button:disabled { opacity: .55; cursor: wait; }

/* Badges, compteurs, tableaux, listes */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .82rem; white-space: nowrap;
         background: var(--row); color: var(--muted); border: 1px solid var(--border); }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.err { background: var(--err-bg); color: var(--err); border-color: transparent; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat { text-align: left; background: var(--card); border: 1px solid var(--border); border-radius: 12px;
        padding: 10px 14px; font: inherit; color: var(--text); cursor: pointer; }
.stat span { display: block; color: var(--muted); font-size: .88rem; }
.stat strong { display: block; font-size: 1.6rem; line-height: 1.2; }
.stat.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
tbody tr:hover { background: var(--row); }
tr.row-link { cursor: pointer; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tabs a { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); }
.tabs a.active { background: var(--card); border: 1px solid var(--border); color: var(--text); font-weight: 600; }
.search { width: 100%; font: inherit; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border);
          background: var(--card); color: var(--text); margin-bottom: 14px; }

/* Formulaires : valeur en gras foncé, suggestion en gris clair */
form.stack { display: grid; gap: 14px; }
label { display: grid; gap: 5px; font-size: .92rem; font-weight: 600; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=datetime-local], input[type=date],
input[type=search], input[type=number], input[type=tel], select, textarea {
  font: inherit; font-weight: 600; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); width: 100%; }
input::placeholder, textarea::placeholder { color: var(--placeholder); font-weight: 400; opacity: 1; }
.grid2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
.code { font-family: ui-monospace, Consolas, monospace; letter-spacing: .06em; }
.recovery-codes { list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: repeat(2, 1fr);
                  gap: 8px 16px; font-size: 1.15rem; }
.recovery-codes li { background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 8px 12px; text-align: center; }
@media print { .topbar, .billing-bar, .demo-bar, .row-actions, .legal-footer { display: none !important; } }
.copybox { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; word-break: break-all;
           background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; }
.suggest-chip { position: absolute; z-index: 50; max-width: min(420px, 90vw); padding: 5px 10px; border-radius: 8px;
                border: 1px solid var(--border); background: var(--card); color: var(--muted); font: inherit;
                font-size: .82rem; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.08); text-align: left;
                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-chip strong { color: var(--text); }
.suggest-chip:hover { border-color: var(--accent); }

/* Étapes (guide) */
.guide-steps { list-style: none; padding: 0; margin: 14px 0 0; counter-reset: step; }
.guide-steps > li { padding: 12px 0; border-top: 1px solid var(--border); }
.guide-steps > li p, .guide-steps > li ul { margin: 6px 0 0 34px; line-height: 1.5; }
.guide-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.guide-check { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border);
               display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700;
               color: var(--muted); counter-increment: step; }
.guide-check::before { content: counter(step); }
.guide-steps > li.done .guide-check { background: var(--open); border-color: var(--open); color: #fff; }
.guide-steps > li.done .guide-check::before { content: "✓"; }
.guide-list { padding-left: 22px; margin: 10px 0 0; }
.guide-list li { margin: 8px 0; line-height: 1.5; }

/* En-tête, menu, cloche */
.topbar { background: var(--card); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1080px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap;
                align-items: center; gap: 6px 18px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; margin-right: auto;
         display: inline-flex; align-items: center; gap: 7px; }
.brand .picto { width: 30px; height: 30px; color: var(--accent); flex: none; }
.brand small { margin-left: -2px; font-weight: 400; color: var(--muted); }
.login-title { display: flex; align-items: center; gap: 10px; }
.login-title .picto { width: 46px; height: 46px; color: var(--accent); flex: none; }
nav { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: .95rem; }
nav a { color: var(--muted); text-decoration: none; padding: 4px 0; }
nav a.active { color: var(--text); font-weight: 600; }
.menu-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 10px; color: var(--text);
               width: 46px; height: 42px; align-items: center; justify-content: center; cursor: pointer; }
.drawer-head, .nav-mobile, .nav-backdrop { display: none; }
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
        border-radius: 10px; color: var(--muted); text-decoration: none; }
.bell:hover, .bell.has-unread { color: var(--text); }
.bell-count { position: absolute; top: -5px; right: -7px; box-shadow: 0 0 0 2px var(--card); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
              background: var(--err); color: #fff; font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center; }
.bell-count.inline { position: static; display: inline-block; margin-left: 6px; }
.topbar nav { order: 1; }
.topbar .bell { order: 2; }
.topbar .lang-menu { order: 2; margin-left: 10px; }
.topbar .menu-toggle { order: 3; }
@media (max-width: 720px) {
  .menu-toggle { display: inline-flex; }
  .topbar-inner { flex-wrap: nowrap; gap: 6px; }
  .topbar .menu-toggle { order: 1; margin-left: 0; }
  .topbar .lang-menu { order: 2; margin-left: 0; }
  .topbar .bell { order: 3; }
  .topbar .brand { order: 4; margin: 0 0 0 auto; min-width: 0; flex: 0 1 auto; flex-direction: row-reverse; }
  .topbar .brand span { white-space: nowrap; }
  .topbar .brand small { display: none; }   /* pas de nom de client sur téléphone */
  .topbar nav { position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; width: min(82vw, 320px); order: 5;
                display: flex; flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 0 0 24px;
                background: var(--card); box-shadow: 4px 0 24px rgba(0,0,0,.18); overflow-y: auto;
                transform: translateX(-105%); transition: transform .22s ease; visibility: hidden; }
  .topbar.open nav { transform: none; visibility: visible; }
  .topbar nav a { padding: 15px 20px; border-bottom: 1px solid var(--border); font-size: 1.05rem; color: var(--text); }
  .topbar nav a.active { color: var(--accent); background: var(--row); }
  .drawer-head { display: flex; align-items: center; gap: 8px; padding: 18px 20px; font-weight: 700;
                 border-bottom: 1px solid var(--border); padding-top: max(18px, env(safe-area-inset-top)); }
  .drawer-head .picto { width: 30px; height: 30px; color: var(--accent); flex: none; }
  .drawer-head small { font-weight: 400; color: var(--muted); }
  .nav-mobile { display: block; }
  .topbar.open .nav-backdrop:not([hidden]), .topbar.dragging .nav-backdrop:not([hidden]) {
    display: block; position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.35); }
}

/* Notifications */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; border-bottom: 1px solid var(--border); }
.notif:last-child { border-bottom: 0; }
.notif p { margin: 4px 0; }
.notif .muted { font-size: .85rem; }
.notif.unread { background: var(--row); border-radius: 8px; padding-left: 10px; }
.notif .badge { flex: none; margin-top: 2px; }

/* Choix de la langue */
.lang-corner { max-width: 1080px; margin: 0 auto; padding: 10px 16px 0; display: flex; justify-content: flex-end; }
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer;
                     padding: 6px 8px; border-radius: 8px; color: var(--text); }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { background: var(--row); }
.lang-menu .flag { width: 24px; height: 16px; border-radius: 3px; box-shadow: 0 0 0 1px var(--border); flex: none; }
.lang-menu .chevron { width: 12px; height: 8px; transition: transform .15s; }
.lang-menu[open] .chevron { transform: rotate(180deg); }
.lang-menu ul { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; list-style: none; margin: 0; padding: 6px;
                min-width: 180px; background: var(--card); border: 1px solid var(--border); border-radius: 12px;
                box-shadow: 0 12px 30px rgba(15, 39, 71, .15); }
.lang-menu li + li { border-top: 1px solid var(--border); }
.lang-menu ul a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
                  color: var(--text); text-decoration: none; font-size: .95rem; }
.lang-menu ul a:hover { background: var(--row); }
.lang-menu ul a[aria-current] { font-weight: 600; }

/* Pages légales et pied de page */
.legal-footer { text-align: center; font-size: .82rem; color: var(--muted); padding: 18px 16px 26px; }
.legal-footer a { color: var(--muted); }
.legal h2 { font-size: 1.05rem; margin: 20px 0 6px; }
.legal p, .legal li { line-height: 1.5; }
.legal-section { padding: 14px 0; border-top: 1px solid var(--border); }
.legal-section:first-of-type { border-top: 0; padding-top: 4px; }
.legal-section h2 { margin: 0 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.legal-section p { margin: 0; overflow-wrap: anywhere; }

/* Flexi Play : ajouts (pictogramme en image couleur, liens de connexion) */
.brand .picto, .drawer-head .picto { border-radius: 7px; }
.login-title .picto { border-radius: 11px; }
.login-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 14px; font-size: .95rem; }
.qr svg { display: block; margin: 8px auto; max-width: 220px; height: auto; border-radius: 8px; }
.steps-inline { padding-left: 20px; margin: 8px 0 14px; line-height: 1.5; }
.badge-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nav-logout .linkbtn { font-size: .95rem; padding: 4px 0; }
@media (max-width: 720px) {
  .topbar nav .nav-logout { display: block; }
  .topbar nav .nav-logout .linkbtn { width: 100%; text-align: left; padding: 15px 20px; font-size: 1.05rem; color: var(--muted); }
}

/* Flexi Play : fiche joueur et niveaux */
.level-big { font-size: 1.5rem; font-weight: 700; color: var(--accent); margin: 4px 0 8px; }
fieldset.checks, fieldset.quiz { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
fieldset.checks legend, fieldset.quiz legend { font-weight: 600; font-size: .92rem; margin-bottom: 6px; padding: 0; }
fieldset.card.quiz { padding: 16px 20px; border: 1px solid var(--border); }
fieldset.card.quiz legend { float: left; width: 100%; font-size: 1rem; margin-bottom: 10px; }
fieldset.card.quiz legend + * { clear: both; }
.quiz-num { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff;
            align-items: center; justify-content: center; font-size: .8rem; margin-right: 6px; }
.level-scale { list-style: none; padding: 0; margin: 0; }
.level-scale li { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.level-scale li:first-child { border-top: 0; padding-top: 0; }
.level-scale p { margin: 4px 0 0; line-height: 1.45; }
.level-num { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff;
             display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }

/* Flexi Play : parties et conversation */
.grid3 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.align-end { align-self: end; padding-bottom: 10px; }
.result-count { font-weight: 600; color: var(--muted); margin: 14px 0 10px; }
.game-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.game-card { display: block; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
             color: var(--text); text-decoration: none; }
.game-card:hover { border-color: var(--accent); box-shadow: 0 3px 12px rgba(0,0,0,.06); }
.game-when { font-weight: 700; }
.game-when::first-letter { text-transform: uppercase; }
.game-place { color: var(--muted); margin: 2px 0 8px; }
.game-title { font-size: 1.25rem; }
.game-note { background: var(--row); border-radius: 9px; padding: 10px 12px; margin: 12px 0 0; white-space: pre-line; }
.player-list { list-style: none; padding: 0; margin: 0; }
.player-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--border); }
.player-list li:first-child { border-top: 0; }
.player-name { font-weight: 600; }
.push-right { margin-left: auto; }
.danger-summary { color: var(--err); cursor: pointer; }
.chat { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; max-height: 60vh; overflow-y: auto; }
.chat-msg { background: var(--row); border: 1px solid var(--border); border-radius: 12px 12px 12px 4px; padding: 8px 12px; max-width: 85%; }
.chat-msg.mine { justify-self: end; background: var(--ok-bg); border-color: transparent; border-radius: 12px 12px 4px 12px; }
.chat-meta { font-size: .78rem; color: var(--muted); margin-bottom: 2px; }
.chat-body { white-space: pre-line; overflow-wrap: anywhere; }
.chat-system { text-align: center; font-size: .85rem; color: var(--muted); padding: 2px 8px; }
.chat-time { font-size: .75rem; opacity: .8; margin-left: 4px; }

/* Flexi Play : photos des joueurs */
.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--row); border: 1px solid var(--border); }
.avatar-initials { display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
                   color: #fff; background: var(--accent); border-color: transparent; }
.photo-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.player-link { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.player-link:hover .player-name { text-decoration: underline; }
input[type=file] { font: inherit; font-weight: 400; }

/* Flexi Play : choix direct du niveau */
.level-option { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border);
                border-radius: 999px; font-weight: 600; cursor: pointer; background: var(--bg); }
.level-option:has(input:checked) { border-color: var(--accent); background: var(--card); box-shadow: inset 0 0 0 1px var(--accent); }
.level-option input { margin: 0; }