:root{
      --bg:#151416;--panel:#211f23;--panel2:#29262b;--line:#3b373e;
      --text:#f4f1f5;--muted:#aaa3ad;--accent:#c07aa2;--accent2:#9e5f84;
      --stable:#2d9a5b;--unstable:#d88a20;--broken:#b94646;
      --shadow:0 12px 34px rgba(0,0,0,.32);--radius:16px;
    }
    *{box-sizing:border-box}
    html{scroll-behavior:smooth}
    body{margin:0;background:linear-gradient(180deg,#171518 0,#121113 100%);color:var(--text);font:15px/1.45 Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;min-height:100vh}
    button,input,select{font:inherit}
    button{cursor:pointer}
    a{color:#e8b7d1;text-decoration:none}
    a:hover{text-decoration:underline}
    .app{max-width:1440px;margin:0 auto;padding:24px}
    .topbar{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:22px;position:sticky;top:0;z-index:30;padding:12px 0;background:rgba(21,20,22,.92);backdrop-filter:blur(14px)}
    .brand{display:flex;align-items:center;gap:12px;min-width:0}
    .logo{width:42px;height:42px;border-radius:12px;background:linear-gradient(145deg,#cf85ad,#8d4e74);display:grid;place-items:center;font-weight:900;font-size:22px;box-shadow:var(--shadow)}
    .brand h1{font-size:22px;margin:0;white-space:nowrap}.brand p{margin:1px 0 0;color:var(--muted);font-size:12px}
    .actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
    .btn,.select{border:1px solid var(--line);background:#2a272c;color:var(--text);border-radius:10px;padding:9px 12px}
    .btn:hover{background:#353039}.btn.primary{background:var(--accent2);border-color:#b46e96}.btn.primary:hover{background:#ad6a91}.btn.ghost{background:transparent}
    .sync{font-size:12px;color:var(--muted);min-width:95px;text-align:right}.sync.ok{color:#8bd0a9}.sync.bad{color:#efa5a5}
    .grid{display:grid;grid-template-columns:310px 1fr;gap:20px;align-items:start}
    .side{display:flex;flex-direction:column;gap:16px;position:sticky;top:90px}
    .card{background:rgba(33,31,35,.94);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
    .card-head{padding:16px 18px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:10px}
    .card-head h2,.card-head h3{margin:0;font-size:16px}.card-body{padding:16px 18px}
    .links{display:grid;gap:8px}.quick-link{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#2a272c;border:1px solid #3c3740;border-radius:10px;padding:10px 11px}.quick-link span{color:#ddd7df}.quick-link b{color:#e7aac9;font-size:13px}
    .legend{display:grid;gap:8px}.legend-row{display:flex;align-items:center;gap:9px;color:#c9c3cb}.dot{width:10px;height:10px;border-radius:999px}.stable{background:var(--stable)}.unstable{background:var(--unstable)}.broken{background:var(--broken)}
    .stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.stat{background:#2a272c;border:1px solid var(--line);border-radius:10px;padding:9px;text-align:center}.stat strong{display:block;font-size:18px}.stat small{color:var(--muted)}
    .content{min-width:0}.section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px}.section-title h2{margin:0;font-size:19px}.section-title p{margin:2px 0 0;color:var(--muted);font-size:13px}
    .tables{display:grid;gap:16px}.game-table{overflow:hidden}.table-title{background:linear-gradient(90deg,#bb739b,#9e6687);padding:13px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px}.table-title h3{margin:0;font-size:18px}.table-meta{color:#f4dfe9;font-size:12px}.table-actions{display:flex;gap:6px}.icon-btn{border:1px solid rgba(255,255,255,.22);background:rgba(0,0,0,.12);color:#fff;border-radius:8px;padding:6px 9px}.icon-btn:hover{background:rgba(0,0,0,.25)}
    table{width:100%;border-collapse:collapse;table-layout:fixed}th,td{border-top:1px solid #3d3940;padding:9px 10px;text-align:center}th{background:#5a575b;color:#fff;font-weight:700}td{background:#302d32}.col-player{width:20%}.col-game{width:39%}.col-dl{width:21%}.col-yaml{width:20%}
    .game-cell{position:relative;padding:0;background:#302d32;color:#f7f4f8;transition:background .15s ease,color .15s ease}
    .game-input{display:block;width:100%;min-height:44px;border:0;border-radius:0;background:transparent;color:inherit;padding:9px 12px;text-align:center;outline:none;font-weight:700}
    .game-input::placeholder{color:#bdb6c0;font-weight:500}
    .game-input:focus{box-shadow:inset 0 0 0 2px #e1a0c3}
    .game-cell.status-stable{background:#258a52;color:#fff}.game-cell.status-unstable{background:#d98a1e;color:#171217}.game-cell.status-broken{background:#b84646;color:#fff}
    .game-cell.status-stable .game-input,.game-cell.status-broken .game-input{color:#fff}.game-cell.status-unstable .game-input{color:#171217}
    .game-dropdown{position:fixed;z-index:20000;display:none;max-height:320px;overflow:auto;background:#1f1c21;border:1px solid #5b5360;border-radius:10px;box-shadow:0 18px 45px rgba(0,0,0,.55);padding:5px;color:#fff}
    .game-dropdown.show{display:block}
    .game-option{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;border:0;background:transparent;color:#f8f5f9;text-align:left;padding:9px 10px;border-radius:7px;cursor:pointer}
    .game-option:hover,.game-option.active{background:#3a333d}.game-option-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.game-option-status{flex:0 0 auto;font-size:11px;font-weight:800;padding:2px 7px;border-radius:999px}
    .game-option-status.stable{background:#258a52;color:#fff}.game-option-status.unstable{background:#d98a1e;color:#171217}.game-option-status.broken{background:#b84646;color:#fff}
    .game-dropdown-empty{padding:12px;color:#bdb6c0;text-align:center}
    .active-player-select{display:flex;align-items:center;gap:8px;border:1px solid var(--line);background:#2a272c;border-radius:10px;padding:5px 7px 5px 10px;color:#d9d3dc;font-size:13px}.active-player-control{position:relative;display:inline-flex;align-items:center}.active-player-control select{appearance:none;-webkit-appearance:none;border:0;outline:0;background:#211f23;color:#fff;border-radius:8px;padding:6px 30px 6px 10px;font-weight:800;min-width:118px;cursor:pointer}.active-player-arrow{position:absolute;right:9px;pointer-events:none;color:#dca4c3;font-size:12px}
    #activePlayer option{background:#2a272c;color:#fff}
    .field input,.field select,.wish-game-edit{color:#fff;background:#2b282d}
    .field input::placeholder,.wish-game-edit::placeholder{color:#aaa3ad}
    .btn,.icon-btn,.quick-link,.dl-chip{color:#f7f4f8}

    .dl-links{display:flex;gap:6px;justify-content:center;align-items:center;flex-wrap:wrap}.dl-chip{display:inline-flex;align-items:center;border:1px solid #5b4d5b;background:#252228;border-radius:999px;padding:4px 8px;font-size:12px;color:#edb8d3;white-space:nowrap}.no-link{color:#7f7882;font-size:12px}
    .yaml-cell{padding:7px 8px}.yaml-actions{display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap}.yaml-name{display:block;max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#ddd6df;font-size:12px}.yaml-btn{display:inline-flex;align-items:center;justify-content:center;border:1px solid #5b5360;background:#29252b;color:#f7f4f8;border-radius:8px;padding:6px 9px;font-size:12px;line-height:1.1;text-decoration:none}.yaml-btn:hover{background:#373139;text-decoration:none}.yaml-btn.upload{border-color:#805f73;background:#4a3340;color:#ffd9eb}.yaml-btn.download{border-color:#486a5a;background:#24372f;color:#bff0d4}.yaml-btn.delete{border-color:#74414a;background:#4b292f;color:#ffc8d0}.yaml-empty{color:#8f8791;font-size:12px}
    .profiles-wrap{margin-top:22px}.profiles{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}.profile-card{background:#211f23;border:1px solid var(--line);border-radius:14px;padding:14px;min-width:0}.profile-top{display:flex;align-items:center;gap:9px;margin-bottom:10px}.avatar{width:34px;height:34px;border-radius:50%;background:#5e4657;display:grid;place-items:center;font-weight:800}.profile-card h3{margin:0;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.profile-card small{color:var(--muted)}.wish-mini{display:flex;flex-direction:column;gap:6px}.wish-item{background:#2a272c;border-radius:8px;padding:7px 8px;font-size:12px}.wish-item b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.interest{color:#dba0c0}.profile-edit{width:100%;margin-top:10px}
    .empty{border:1px dashed #49444c;border-radius:14px;padding:28px;text-align:center;color:var(--muted);background:#1d1b1f}.empty strong{display:block;color:#d8d2da;margin-bottom:5px}
    dialog{border:1px solid #4a444d;background:#201e22;color:#fff;border-radius:16px;box-shadow:0 25px 80px rgba(0,0,0,.6);padding:0;width:min(620px,calc(100vw - 28px))}dialog::backdrop{background:rgba(5,4,6,.72);backdrop-filter:blur(4px)}.modal-head{padding:16px 18px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center}.modal-head h2{font-size:18px;margin:0}.modal-body{padding:18px}.modal-foot{padding:14px 18px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:8px}.field{display:grid;gap:6px;margin-bottom:14px}.field label{font-weight:700;font-size:13px}.field input,.field select{width:100%;background:#2b282d;color:#fff;border:1px solid #4a454d;border-radius:9px;padding:9px 10px}.participants-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}.participants-head label{margin:0}.participants-tools{display:flex;gap:6px}.participants-tools button{border:1px solid #514a55;background:#28252a;color:#e9e4eb;border-radius:8px;padding:4px 8px;font-size:12px;cursor:pointer}.participants-tools button:hover{background:#363139}.players-checks{display:grid;grid-template-columns:repeat(auto-fit,minmax(165px,1fr));gap:10px}.player-choice{display:block;cursor:pointer;user-select:none}.player-choice input{position:absolute;opacity:0;pointer-events:none}.player-choice-inner{display:grid;grid-template-columns:38px 1fr 26px;gap:10px;align-items:center;min-height:58px;background:#2a272c;border:1px solid #47414a;border-radius:12px;padding:10px 11px;transition:.15s ease}.player-choice:hover .player-choice-inner{background:#332f35;border-color:#655b68}.player-choice-avatar{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:#5a4654;color:#fff;font-weight:900}.player-choice-name{font-weight:800;color:#f7f4f8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.player-choice-check{width:24px;height:24px;border-radius:7px;border:1px solid #655e68;display:grid;place-items:center;color:transparent;background:#211f23;font-weight:900}.player-choice input:checked + .player-choice-inner{background:#3a2b35;border-color:#ca82aa;box-shadow:inset 0 0 0 1px rgba(202,130,170,.25)}.player-choice input:checked + .player-choice-inner .player-choice-avatar{background:#a45f86}.player-choice input:checked + .player-choice-inner .player-choice-check{background:#bd739b;border-color:#d690b6;color:#fff}.wish-list{display:grid;gap:8px;margin-top:14px}.wish-edit-row{display:grid;grid-template-columns:1fr 120px 36px;gap:8px;align-items:center}.wish-edit-row input[type=range]{width:100%}.remove{background:#4d292f;border:1px solid #6c343d;color:#ffc9d0;border-radius:8px;height:34px}.range-wrap{display:grid;grid-template-columns:1fr 28px;align-items:center;gap:5px}.range-value{text-align:center;font-weight:800;color:#eab2d0}
    .modal-overlay{position:fixed;inset:0;z-index:10000;background:rgba(5,4,6,.74);backdrop-filter:blur(4px);display:grid;place-items:center;padding:14px}.modal-overlay[hidden]{display:none}.modal-panel{width:min(620px,calc(100vw - 28px));max-height:calc(100vh - 28px);overflow:auto;border:1px solid #4a444d;background:#201e22;color:#fff;border-radius:16px;box-shadow:0 25px 80px rgba(0,0,0,.6)}.toast{position:fixed;right:20px;bottom:20px;background:#2b282d;border:1px solid #514a55;border-radius:12px;padding:11px 14px;box-shadow:var(--shadow);opacity:0;transform:translateY(12px);pointer-events:none;transition:.2s;z-index:99}.toast.show{opacity:1;transform:none}
    .catalog-stat{appearance:none;-webkit-appearance:none;color:var(--text);font:inherit;cursor:pointer;transition:transform .12s ease,background .12s ease,border-color .12s ease}.catalog-stat:hover{background:#353039;border-color:#705f73;transform:translateY(-1px)}.catalog-stat:focus-visible{outline:2px solid #e1a0c3;outline-offset:2px}.catalog-stat strong,.catalog-stat small{pointer-events:none}
    .game-group-title{position:sticky;top:-5px;z-index:2;margin:4px 0;padding:7px 9px;background:#28232a;border-bottom:1px solid #4d4550;color:#e9d9e3;font-size:11px;font-weight:900;letter-spacing:.06em;text-transform:uppercase}.game-group-title:first-child{margin-top:0}
    .catalog-panel{width:min(760px,calc(100vw - 28px))}.catalog-subtitle{margin-top:2px;color:var(--muted);font-size:12px}.catalog-game-list{display:grid;gap:7px;max-height:min(65vh,620px);overflow:auto;padding-right:3px}.catalog-game-item{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#2a272c;border:1px solid #3f3942;border-radius:10px;padding:9px 10px}.catalog-game-name{font-weight:700;color:#f7f4f8;min-width:0}.catalog-game-links{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}.catalog-game-list .dl-chip{font-size:11px}.catalog-no-links{color:#7f7882;font-size:11px}
    @media(max-width:1050px){.grid{grid-template-columns:1fr}.side{position:static;display:grid;grid-template-columns:1fr 1fr}.profiles{grid-template-columns:repeat(2,1fr)}}
    @media(max-width:700px){.app{padding:12px}.topbar{align-items:flex-start;position:static}.brand p{display:none}.actions{justify-content:flex-start}.grid{display:block}.side{display:grid;grid-template-columns:1fr;margin-bottom:14px}.profiles{grid-template-columns:1fr}.table-title{align-items:flex-start}table{table-layout:auto}.col-player{width:20%}.col-game{width:38%}.col-dl{width:22%}.col-yaml{width:20%}th,td{padding:7px 6px}.dl-chip{font-size:11px}.players-checks{grid-template-columns:1fr}.wish-edit-row{grid-template-columns:1fr}.sync{display:none}}

/* === Desktop plein écran — v3 === */
html,body{width:100%;min-width:1280px}
body{overflow-x:auto}
.app{width:100vw;max-width:none!important;margin:0!important;padding:16px 18px 28px!important}
.topbar{width:100%;margin-bottom:18px}
.grid{width:100%;grid-template-columns:280px minmax(0,1fr)!important;gap:18px!important;align-items:start}
.content{width:100%;min-width:0}
.side{width:280px}
.game-table{width:100%}
table{width:100%;table-layout:fixed}
.col-player{width:12%}.col-game{width:31%}.col-dl{width:38%}.col-yaml{width:19%}
.dl-links{gap:7px}
.profiles{width:100%;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:12px}
.profile-top{display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:9px;align-items:center}
.profile-meta{min-width:0}
.wish-toggle{width:28px;height:28px;padding:0;border:1px solid #5b5360;border-radius:8px;background:#2a272c;color:#f4d4e5;font-size:16px;line-height:1;display:grid;place-items:center}
.wish-toggle:hover{background:#39333b}
.logo{overflow:hidden;flex:0 0 42px}
.logo img{width:100%;height:100%;object-fit:contain;display:block}
.logo.logo-fallback::after{content:"A"}
.room-row{display:grid;grid-template-columns:minmax(0,1fr) 38px;gap:7px;align-items:stretch}
.room-link{min-width:0;background:linear-gradient(135deg,rgba(158,95,132,.30),#2a272c);border-color:#725568}
.room-link.room-unset{opacity:.78}
.room-edit-btn{border:1px solid #5b5360;background:#2a272c;color:#efc0d9;border-radius:10px;font-size:17px;display:grid;place-items:center;padding:0}
.room-edit-btn:hover{background:#39323a;border-color:#8a6079}
.catalog-search{position:relative;display:flex;align-items:center;margin-bottom:12px}
.catalog-search-icon{position:absolute;left:12px;color:#9f97a2;font-size:20px;pointer-events:none}
.catalog-search input{width:100%;border:1px solid #4a454d;background:#28252a;color:#fff;border-radius:10px;padding:10px 40px 10px 38px;outline:none}
.catalog-search input:focus{border-color:#b47399;box-shadow:0 0 0 3px rgba(192,122,162,.15)}
.catalog-search-clear{position:absolute;right:7px;border:0;background:transparent;color:#aaa3ad;border-radius:7px;padding:5px 8px;opacity:0;pointer-events:none}
.catalog-search-clear.show{opacity:1;pointer-events:auto}.catalog-search-clear:hover{background:#3a353c;color:#fff}
.catalog-empty{padding:30px 18px;text-align:center;color:var(--muted);border:1px dashed #49444c;border-radius:12px;background:#211f23}

/* On privilégie volontairement le bureau : aucune réduction de la grille principale. */
@media(max-width:1050px){.grid{grid-template-columns:280px minmax(900px,1fr)!important}.side{position:sticky;top:90px;display:flex}.profiles{grid-template-columns:repeat(5,minmax(190px,1fr))!important}}
@media(max-width:700px){.app{padding:16px 18px 28px!important}.topbar{position:sticky;align-items:center}.brand p{display:block}.actions{justify-content:flex-end}.grid{display:grid!important}.side{display:flex!important;margin-bottom:0}.profiles{grid-template-columns:repeat(5,minmax(190px,1fr))!important}table{table-layout:fixed}.sync{display:block}}


/* v4 : Room par tableau + tableau plus compact + cartes joueurs indépendantes */
.tables{width:min(100%,1320px);max-width:1320px}
.game-table{width:100%;max-width:1320px}
.table-actions{align-items:center;flex-wrap:wrap;justify-content:flex-end}
.table-room-link{display:inline-flex;align-items:center;border:1px solid rgba(255,255,255,.24);background:rgba(44,33,42,.34);color:#ffe0f0;border-radius:8px;padding:6px 10px;font-size:13px;font-weight:800;text-decoration:none;white-space:nowrap}
.table-room-link:hover{background:rgba(0,0,0,.23);text-decoration:none}
.table-room-empty{border-color:rgba(255,255,255,.28);color:#ffe0f0}
.profiles{align-items:start!important}
.profile-card{align-self:start;height:auto!important}

/* Bouton et aperçu de mise à jour du catalogue (2026-10-28) */
.catalog-import-action{margin-top:16px;padding-top:14px;border-top:1px solid var(--line);display:grid;gap:7px}
.catalog-import-btn{width:100%;font-weight:700;font-size:13px;background:#463042!important;border-color:#8a5279!important;color:#fff!important}
.catalog-import-btn:hover{background:#63405b!important}
.catalog-import-action small{font-size:11px;color:var(--muted);text-align:center;line-height:1.35}
.catalog-import-panel{width:min(620px,calc(100vw - 30px))}
.catalog-import-help{font-size:13px;line-height:1.6;margin:0 0 12px;color:#e0d6df}
.catalog-import-preview{border:1px solid #5b4557;background:#2e2530;padding:13px 14px;border-radius:9px;font-size:13px;line-height:1.7;color:#f5dce9;margin:10px 0 14px}
.catalog-import-preview.error{border-color:#a75c5c;color:#ffbcbc}
.catalog-import-preview.ok{border-color:#688774;color:#c9f0d3}
.catalog-import-note{font-size:12px;line-height:1.5;color:var(--muted);margin:0}
#catalogExcelFile{display:block;width:100%;max-width:100%}
#catalogAdminCode{width:100%}
#catalogImportSave:disabled{opacity:.48;cursor:not-allowed}
