/* Comptes et classement : mini-classement des jeux, fenêtres, page /classement/ */
:root {
    --lb-bg: #1a1a1a;
    --lb-panel: #232323;
    --lb-panel-2: #2c2c2c;
    --lb-line: #404040;
    --lb-text: #e0e0e0;
    --lb-muted: #9e9e9e;
    --lb-accent: #29b6f6;
    --lb-accent-ink: #0b1a22;
    --lb-gold: #f5c542;
    --lb-good: #66bb6a;
    --lb-bad: #ff8a80;
}

/* ---------- Bouton compte (pages de jeu) ---------- */
#account-btn.lb-logged { box-shadow: inset 0 -3px 0 var(--lb-accent); }

/* ---------- Mini classement (en haut à gauche des jeux) ---------- */
.lb-mini {
    display: block;
    width: 100%;
    max-width: 250px;
    margin-top: 10px;
    padding: 8px 10px;
    background: var(--lb-panel);
    border: 1px solid var(--lb-line);
    border-radius: 8px;
    color: var(--lb-text);
    text-decoration: none;
    font-size: .8rem;
    line-height: 1.5;
    transition: border-color .2s, transform .2s;
}
.lb-mini:hover, .lb-mini:focus-visible { border-color: var(--lb-accent); transform: translateY(-1px); outline: none; }
.lb-mini-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; color: var(--lb-accent); }
.lb-mini-head span:last-child { font-weight: 400; color: var(--lb-muted); }
.lb-mini ol { list-style: none; margin: 4px 0 0; padding: 0; }
.lb-mini li { display: flex; gap: 6px; align-items: baseline; }
.lb-mini li b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lb-mini li.me b { color: var(--lb-accent); }
.lb-mini .n { color: var(--lb-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-mini-empty { margin: 4px 0 0; color: var(--lb-muted); font-size: .8rem; }
.lb-mini-me { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--lb-line); color: var(--lb-muted); }
.lb-mini-me b { color: var(--lb-text); }
.lb-mini-note { color: var(--lb-gold); }

@media (max-width: 760px) {
    .lb-mini ol, .lb-mini-empty { display: none; }
}

/* ---------- Fenêtres ---------- */
.lb-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, .7);
    animation: lb-fade .15s ease-out;
}
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }
.lb-modal {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 430px;
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding: 26px 24px 22px;
    background: var(--lb-panel-2);
    border: 1px solid var(--lb-line);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
    color: var(--lb-text);
    font-size: 1rem;
    line-height: 1.5;
    text-align: left;
}
.lb-modal h2 { margin: 0 0 14px; font-size: 1.3rem; color: var(--lb-accent); }
.lb-modal .lb-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--lb-muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transform: none;
}
.lb-modal .lb-close:hover { background: var(--lb-panel); color: var(--lb-text); transform: none; }

.lb-tabs { display: flex; gap: 4px; margin-bottom: 16px; padding: 4px; background: var(--lb-bg); border-radius: 8px; }
.lb-tabs .lb-tab {
    flex: 1;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--lb-muted);
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transform: none;
}
.lb-tabs .lb-tab:hover { background: var(--lb-panel); color: var(--lb-text); transform: none; }
.lb-tabs .lb-tab[aria-selected="true"] { background: var(--lb-accent); color: var(--lb-accent-ink); }

.lb-field { display: block; margin-bottom: 12px; }
.lb-field[hidden] { display: none; }
.lb-field > span { display: block; margin-bottom: 4px; font-size: .85rem; color: var(--lb-muted); }
.lb-input {
    box-sizing: border-box;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--lb-line);
    border-radius: 6px;
    background: var(--lb-bg);
    color: var(--lb-text);
    font: inherit;
    font-size: 1rem;
}
.lb-input:focus { outline: none; border-color: var(--lb-accent); }

.lb-btn, button.lb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    padding: 10px 16px;
    border: 1px solid var(--lb-line);
    border-radius: 6px;
    background: var(--lb-panel);
    color: var(--lb-text);
    font: inherit;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transform: none;
    transition: background-color .2s, border-color .2s;
}
.lb-btn:hover, button.lb-btn:hover { background: #383838; border-color: var(--lb-accent); transform: none; }
.lb-btn.primary, button.lb-btn.primary { background: var(--lb-accent); border-color: var(--lb-accent); color: var(--lb-accent-ink); }
.lb-btn.primary:hover, button.lb-btn.primary:hover { background: #4fc3f7; }
.lb-btn.danger, button.lb-btn.danger { border-color: #8e3b36; color: var(--lb-bad); }
.lb-btn.danger:hover, button.lb-btn.danger:hover { background: #3a2422; border-color: var(--lb-bad); }
.lb-btn:disabled { opacity: .6; cursor: default; }
.lb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.lb-actions > .lb-btn { flex: 1 1 auto; }

.lb-error { min-height: 1.3em; margin: 2px 0 0; color: var(--lb-bad); font-size: .9rem; }
.lb-hint { margin: 12px 0 0; color: var(--lb-muted); font-size: .82rem; line-height: 1.45; }
.lb-hint a { color: var(--lb-accent); }

.lb-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 1100;
    transform: translateX(-50%);
    padding: 10px 18px;
    border: 1px solid var(--lb-line);
    border-radius: 8px;
    background: var(--lb-panel-2);
    color: var(--lb-text);
    font-size: .95rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
    animation: lb-fade .2s ease-out;
}

/* ---------- Résultat de partie ---------- */
.lb-result { text-align: center; }
.lb-result-kicker { margin: 0; color: var(--lb-muted); font-size: .95rem; }
.lb-result-time { margin: 0; color: var(--lb-text); font-size: 2.6rem; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.lb-result-song { margin: 6px 0 0; color: var(--lb-muted); }
.lb-result-song b { color: var(--lb-text); }
.lb-result-list { display: grid; gap: 6px; margin: 16px 0 0; padding: 0; list-style: none; text-align: left; }
.lb-result-list li { padding: 8px 12px; border-radius: 6px; background: var(--lb-bg); font-size: .92rem; }
.lb-gold { color: var(--lb-gold); font-weight: 700; }
.lb-result .lb-hint { text-align: center; }

/* ---------- Page /classement/ ---------- */
body.lb-page {
    margin: 0;
    min-height: 100vh;
    background: var(--lb-bg);
    color: var(--lb-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}
.lb-page *, .lb-page *::before, .lb-page *::after { box-sizing: border-box; }
.lb-wrap { max-width: 1120px; margin: 0 auto; padding: 24px 16px 56px; }
.lb-top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; margin-bottom: 18px; }
.lb-top h1 { margin: 2px 0 0; color: var(--lb-accent); font-size: 2rem; line-height: 1.2; }
.lb-back { color: var(--lb-muted); text-decoration: none; font-size: .9rem; }
.lb-back:hover { color: var(--lb-text); }
.lb-spacer { flex: 1; }
.lb-account-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lb-account-box .who { color: var(--lb-muted); }
.lb-account-box .who b { color: var(--lb-text); }

.lb-filters { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 18px; }
.lb-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--lb-panel); border: 1px solid var(--lb-line); border-radius: 8px; }
.lb-seg button {
    padding: 7px 14px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--lb-muted);
    font: inherit;
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
}
.lb-seg button:hover { color: var(--lb-text); background: var(--lb-panel-2); }
.lb-seg button[aria-pressed="true"] { background: var(--lb-accent); color: var(--lb-accent-ink); }

.lb-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.lb-tile { padding: 14px 16px; background: var(--lb-panel); border: 1px solid var(--lb-line); border-radius: 10px; min-width: 0; }
.lb-tile .k { color: var(--lb-muted); font-size: .8rem; }
.lb-tile .v { margin-top: 2px; font-size: 1.6rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-tile .s { color: var(--lb-muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lb-card { min-width: 0; margin-bottom: 16px; padding: 18px; background: var(--lb-panel); border: 1px solid var(--lb-line); border-radius: 10px; }
.lb-card[hidden] { display: none; }
.lb-card h2 { margin: 0 0 4px; font-size: 1.1rem; color: var(--lb-text); }
.lb-sub { margin: 0 0 12px; color: var(--lb-muted); font-size: .85rem; }
.lb-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.lb-cols > * { min-width: 0; }
@media (max-width: 860px) { .lb-cols { grid-template-columns: minmax(0, 1fr); } }

.lb-scroll { overflow-x: auto; }
.lb-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.lb-table th { padding: 6px 10px; border-bottom: 1px solid var(--lb-line); color: var(--lb-muted); font-size: .76rem; font-weight: 600; text-align: left; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.lb-table td { padding: 8px 10px; border-bottom: 1px solid #303030; vertical-align: middle; }
.lb-table tr:last-child td { border-bottom: 0; }
.lb-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-table .rank { width: 1%; color: var(--lb-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-table tr.me td { background: rgba(41, 182, 246, .10); }
.lb-table tr.me td:first-child { box-shadow: inset 3px 0 0 var(--lb-accent); }
.lb-table .song b { display: block; }
.lb-table .song span { color: var(--lb-muted); font-size: .85rem; }
.lb-table .empty { padding: 18px 10px; color: var(--lb-muted); text-align: center; }
.lb-name { font-weight: 600; }
.lb-you { margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: var(--lb-accent); color: var(--lb-accent-ink); font-size: .7rem; font-weight: 700; vertical-align: middle; }

.lb-list { margin: 0; padding: 0; list-style: none; }
.lb-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #303030; }
.lb-list li:last-child { border-bottom: 0; }
.lb-list .ico { flex: none; width: 1.6em; text-align: center; font-size: 1.1rem; }
.lb-list .main { flex: 1; min-width: 0; }
.lb-list .main b, .lb-list .main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-list .main span { color: var(--lb-muted); font-size: .84rem; }
.lb-list .end { flex: none; font-variant-numeric: tabular-nums; font-weight: 700; }
.lb-list li.me .main b { color: var(--lb-accent); }
.lb-list .empty { color: var(--lb-muted); }
.lb-won { color: var(--lb-good); }
.lb-lost { color: var(--lb-bad); }

.lb-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.lb-tools .lb-input { max-width: 320px; }
.lb-more { margin-top: 10px; }

.lb-me-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 12px 0 16px; }
.lb-me-grid .lb-tile { background: var(--lb-bg); }
.lb-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.lb-cta p { flex: 1 1 260px; margin: 0; color: var(--lb-muted); }

.lb-account-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.lb-account-forms form, .lb-account-forms > div { padding: 14px; background: var(--lb-bg); border-radius: 8px; }
.lb-account-forms h3 { margin: 0 0 10px; font-size: 1rem; }
.lb-ok { min-height: 1.3em; margin: 2px 0 0; color: var(--lb-good); font-size: .9rem; }

.lb-foot { margin-top: 28px; color: var(--lb-muted); font-size: .82rem; text-align: center; }
.lb-foot a { color: var(--lb-muted); }

/* L’attribut hidden l’emporte sur le display des boutons */
[hidden] { display: none !important; }
