/* ============================================
   ROUTES PRÉCONFIGURÉES (Rush, Mono, Multi)
   ============================================ */

.preset {
    padding: calc(var(--nav-height) + 30px) 16px 60px;
    max-width: 680px;
    margin: 0 auto;
    min-height: 100vh;
}

.preset__card {
    margin-top: 24px;
}

.preset__row {
    display: flex;
    gap: 16px;
}

.preset__row > * {
    flex: 1;
    min-width: 0;
}

.preset__subtitle {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1rem;
    margin-top: 8px;
}

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

.preset-choice {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    text-align: left;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font: inherit;
}

.preset-choice.is-active {
    border-color: var(--twitch-purple);
    background: rgba(255, 138, 61, 0.1);
}

.preset-choice__title {
    font-weight: 700;
}

.preset-choice__desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

@media (max-width: 600px) {
    .preset__row,
    .preset__choices {
        display: flex;
        flex-direction: column;
    }
}

/* ===== Récap de la partie (mode et réglages), en tête de la colonne de gauche ===== */
.game-recap {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.game-recap[hidden] { display: none; }

.game-recap__title {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.game-recap__opts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 3px 10px;
    font-size: 0.76rem;
    color: var(--text-secondary);
}

/* ===== Bandeau du salon ===== */

/* Inscriptions : en tête de la colonne de gauche, même style que le bloc « Tape ton coup dans le chat » */
.lobby-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.lobby-banner__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-basis: 100%;
    min-width: 0;
}

.lobby-banner__title {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.lobby-banner__hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.lobby-banner__countdown {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.lobby-banner__count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.lobby-banner__countdown:empty, .lobby-banner__count:empty { display: none; }

.lobby-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex-basis: 100%;
}

/* ===== Joueurs inscrits ===== */

.roster {
    max-height: 240px;
    overflow-y: auto;
}

.roster__team {
    margin: 8px 0 4px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.roster__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 0;
}

.roster__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.roster__add {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.roster__add .input {
    flex: 1 1 90px;
    min-width: 0;
}

/* ===== Menu : sept liens sur une seule ligne ===== */

.nav__link,
.nav__logo-text {
    white-space: nowrap;
}

.nav__link {
    padding-left: 11px;
    padding-right: 11px;
}

@media (max-width: 1500px) {
    .nav__logo-text {
        display: none;
    }
}

@media (max-width: 1050px) {
    .nav {
        padding: 0 12px;
    }

    .nav__links {
        gap: 2px;
    }

    .nav__link {
        padding-left: 6px;
        padding-right: 6px;
        font-size: 0.82rem;
    }
}

/* Multi : la partie appartient aux deux chaînes, pas de reset d'un seul côté */
body.preset-multi #btn-reset {
    display: none;
}

/* ── Onglets de Nouveau : Partie libre, Mono, Multi, Puzzle Rush ── */
.new-tabs {
    display: flex;
    gap: 4px;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 20px;
    padding: 4px;
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
}

.new-tab {
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.new-tab:hover {
    color: #ffe8d6;
    background: rgba(255, 138, 61, 0.12);
}

.new-tab.is-active {
    color: var(--on-accent);
    background: var(--twitch-purple);
}

/* Sur l'échiquier, les onglets ne servent qu'à l'écran de lancement */
body:not(.sandbox-launch) #page-sandbox .new-tabs {
    display: none;
}

@media (max-width: 600px) {
    .new-tabs { width: 100%; }
    .new-tab { padding: 8px 12px; }
}

.roster__hint {
    margin: 0 0 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Terminer la partie */
.btn-quit-game {
    border-color: rgba(239, 68, 68, 0.5);
}

.btn-quit-game:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.2);
}

/* ----- Multi : partie publique / privée ----- */

.multi-visibility {
    margin: 4px 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-input);
}

.multi-visibility__switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
}

.multi-visibility__switch input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-purple);
    cursor: pointer;
}

.multi-visibility__desc {
    display: none;
    gap: 8px;
    margin: 8px 0 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.multi-visibility__desc i { margin-top: 3px; }
.multi-visibility__desc--public i { color: var(--accent-green); }
.multi-visibility__desc--private i { color: var(--accent-orange); }

.multi-visibility[data-visibility="public"] .multi-visibility__desc--public,
.multi-visibility[data-visibility="private"] .multi-visibility__desc--private { display: flex; }

/* État du chat Twitch du streamer, dans la liste des inscrits */
.roster__chat {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 3px;
    font-size: 0.82rem;
    line-height: 1.35;
}
.roster__chat.is-ok      { background: rgba(16, 185, 129, 0.12); color: #34d399; }
.roster__chat.is-pending { background: rgba(148, 163, 184, 0.12); color: var(--text-secondary, #94a3b8); }
.roster__chat.is-off     { background: rgba(239, 68, 68, 0.14); color: #f87171; font-weight: 600; }

/* Outils de test de la régie (faux viewers, adversaire fictif) */
.test-tools {
    position: fixed;
    left: 12px;
    bottom: 12px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 260px;
    padding: 10px 12px;
    border: 1px dashed rgba(250, 204, 21, 0.6);
    border-radius: 3px;
    background: rgba(15, 15, 25, 0.92);
    color: #e5e7eb;
    font-size: 0.8rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.test-tools[hidden] { display: none; }
.test-tools__title { font-weight: 700; color: #facc15; }
.test-tools__toggle { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: #facc15; text-align: left; cursor: pointer; }
.test-tools.is-collapsed { padding: 6px 10px; }
.test-tools__row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.test-tools__row select { background: #1f2030; color: inherit; border: 1px solid #3a3b50; border-radius: 2px; padding: 3px 4px; }
.test-tools__info { color: #9ca3af; }
.test-tools__bots { display: flex; flex-wrap: wrap; gap: 4px; max-height: 120px; overflow-y: auto; }
.test-tools__bot { display: inline-flex; align-items: center; gap: 2px; padding: 1px 2px 1px 7px; border: 1px solid #3a3b50; border-radius: 999px; font-size: 0.72rem; white-space: nowrap; }
.test-tools__bot button { border: 0; background: none; color: inherit; opacity: .6; cursor: pointer; padding: 0 4px; font-size: 0.85rem; line-height: 1; }
.test-tools__bot button:hover { opacity: 1; color: #f87171; }

/* Ecran Nouveau : bots de test dans le panneau des modes (meme contenu que le panneau flottant) */
.setup-test-bots {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px dashed rgba(250, 204, 21, 0.6);
    border-radius: 3px;
    font-size: 0.8rem;
}
.setup-test-bots[hidden] { display: none; }

/* Choix de niveau : (stockfish) = joue par Stockfish, (todo) = simule sous son plancher */
.sf-tag { margin-left: 4px; font-size: 0.7em; font-weight: 600; white-space: nowrap; }
.sf-tag--ok { color: #34d399; }
.sf-tag--todo { color: #9ca3af; font-style: italic; }

/* Contre Stockfish : reflexion du moteur dans le bandeau des votes */
.vote-ticker__item.engine-thinking { color: #facc15; font-style: italic; }
