/* ═══════════════════════════════════════════
   freeRound.css — Suivi de victoires
   ═══════════════════════════════════════════ */

#app { max-width: 480px; margin: 0 auto; padding: 0 0 40px; }
header {
    padding: 20px 20px 14px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    position: sticky; top: 0; z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-title { font-family: 'Playfair Display', serif; font-size: 1.15rem; font-weight: 700; color: var(--text); }
.header-title span { color: var(--accent); }
.header-sub { font-size: 0.7rem; color: var(--muted); margin-top: 2px; }
.round-badge {
    font-size: 0.72rem; font-weight: 700;
    padding: 5px 12px; border-radius: 20px;
    background: var(--accent); color: var(--on-accent);
    white-space: nowrap;
}

.section { padding: 16px; }
.section-title {
    font-size: 0.68rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--muted); margin-bottom: 10px;
}

/* ── Add player ── */
.add-form {
    display: flex; gap: 8px; margin-bottom: 16px;
}
.add-form input {
    flex: 1;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem; outline: none;
}
.add-form input:focus { border-color: var(--accent); }
.add-form input::placeholder { color: var(--muted); }
.btn-add {
    padding: 10px 16px;
    border-radius: 12px; border: none;
    background: var(--accent); color: var(--on-accent);
    font-family: 'DM Sans', sans-serif;
    font-weight: 700; font-size: 0.85rem;
    cursor: pointer; white-space: nowrap;
}
.btn-add:active { opacity: 0.85; }

/* ── Scoreboard ── */
.scoreboard { display: flex; flex-direction: column; gap: 8px; }
.sb-empty {
    text-align: center; padding: 30px 16px;
    color: var(--muted); font-size: 0.85rem; line-height: 1.6;
}

.sb-player {
    display: flex; align-items: center; gap: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px 14px;
    transition: all 0.15s;
}
.sb-player.leader {
    border-color: rgba(245,197,66,0.4);
    background: rgba(245,197,66,0.05);
}
.sb-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Playfair Display', serif;
    font-weight: 900; font-size: 1.1rem;
    color: #1a0a2e; flex-shrink: 0;
}
.sb-info { flex: 1; min-width: 0; }
.sb-name {
    font-weight: 700; font-size: 0.95rem; color: var(--text);
    display: flex; align-items: center; gap: 6px;
}
.sb-rank { font-size: 0.8rem; }
.sb-bar-wrap {
    margin-top: 5px; height: 6px;
    background: var(--glass); border-radius: 3px;
    overflow: hidden;
}
.sb-bar {
    height: 100%; border-radius: 3px;
    background: var(--accent);
    transition: width 0.3s ease;
}
.sb-score {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem; font-weight: 900;
    color: var(--accent); flex-shrink: 0;
    min-width: 32px; text-align: center;
}
.sb-remove {
    width: 26px; height: 26px; border-radius: 50%;
    border: 1px solid rgba(255,85,85,0.25);
    background: rgba(255,85,85,0.06);
    color: var(--red); font-size: 0.7rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
    transition: all 0.1s; opacity: 0.5;
}
.sb-remove:active { transform: scale(0.85); opacity: 1; }

/* ── Win picker modal ── */
.modal-overlay {
    position: fixed; inset: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(6px); z-index: 200;
    display: flex; align-items: flex-end; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px 24px 0 0;
    padding: 24px 20px 36px;
    width: 100%; max-width: 480px;
    transform: translateY(60px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh; overflow-y: auto;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-handle { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 20px; }
.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem; font-weight: 700;
    color: var(--accent); margin-bottom: 6px; text-align: center;
}
.modal-sub { font-size: 0.8rem; color: var(--muted); margin-bottom: 20px; text-align: center; }

.win-picker { display: flex; flex-direction: column; gap: 8px; }
.wp-btn {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--glass-subtle);
    cursor: pointer; transition: all 0.15s;
    font-family: 'DM Sans', sans-serif;
    color: var(--text); width: 100%;
}
.wp-btn:active { transform: scale(0.97); border-color: var(--accent); }
.wp-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Playfair Display', serif;
    font-weight: 900; font-size: 0.95rem;
    color: #1a0a2e; flex-shrink: 0;
}
.wp-name { font-weight: 700; font-size: 0.95rem; flex: 1; }
.wp-wins { font-size: 0.78rem; color: var(--muted); }
.wp-cancel {
    display: block; margin-top: 12px; width: 100%;
    padding: 13px; border-radius: 14px;
    border: 1px solid var(--border); background: transparent;
    color: var(--muted); font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem; font-weight: 500;
    cursor: pointer; transition: all 0.15s;
}
.wp-cancel:active { transform: scale(0.97); }

/* ── Selected winner state ── */
.wp-btn.selected {
    border-color: var(--accent);
    background: rgba(245,197,66,0.1);
}

/* ── Confirm win button ── */
.wp-confirm {
    display: block; width: 100%; margin-top: 12px;
    padding: 14px; border-radius: 14px; border: none;
    background: var(--accent); color: var(--on-accent);
    font-family: 'DM Sans', sans-serif;
    font-weight: 700; font-size: 0.95rem;
    cursor: pointer; transition: all 0.15s;
}
.wp-confirm:active { transform: scale(0.97); }

/* ── Info banner ── */
.wt-info-banner {
    background: rgba(56,189,248,0.06);
    border: 1px solid rgba(56,189,248,0.2);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.5;
}
.wt-info-banner strong { color: var(--text); }

/* ── New game modal options ── */
.ng-options {
    display: flex; flex-direction: column; gap: 10px;
    margin-bottom: 4px;
}
.ng-option {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--glass-subtle);
    color: var(--text); cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    text-align: left; width: 100%;
    transition: all 0.15s;
}
.ng-option:active { transform: scale(0.97); border-color: var(--accent); }
.ng-icon { font-size: 1.4rem; flex-shrink: 0; }
.ng-text { flex: 1; }
.ng-title { font-size: 0.92rem; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.ng-sub { font-size: 0.74rem; color: var(--muted); }

/* ── History ── */
.history-list { display: flex; flex-direction: column; gap: 6px; }
.hi-item {
    display: flex; align-items: center; gap: 10px;
    background: var(--glass-subtle);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 9px 14px;
}
.hi-round {
    font-family: 'Playfair Display', serif;
    font-size: 0.82rem; font-weight: 700;
    color: var(--muted); min-width: 18px;
}
.hi-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.hi-name { font-size: 0.85rem; font-weight: 600; color: var(--text); flex: 1; }
.hi-undo {
    width: 24px; height: 24px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--glass);
    color: var(--muted); font-size: 0.65rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0; transition: opacity 0.15s;
}
.hi-item:last-child .hi-undo,
.hi-item:first-child .hi-undo { opacity: 0.5; }
.hi-undo:active { transform: scale(0.85); opacity: 1; }

/* ── Bottom bar ── */
.bottom-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bar-bg);
    border-top: 1px solid var(--border);
    padding: 12px 16px max(12px, env(safe-area-inset-bottom));
    display: flex; gap: 8px; z-index: 100;
    max-width: 480px; margin: 0 auto;
    backdrop-filter: blur(12px);
}
.btn-main {
    flex: 1; padding: 12px 6px;
    border-radius: 12px; border: none;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700; font-size: 0.85rem;
    cursor: pointer; transition: all 0.15s;
}
.btn-main:active { transform: scale(0.95); }
.btn-win { background: var(--accent); color: var(--on-accent); }
.btn-new { background: var(--glass); color: var(--text); border: 1px solid var(--border); }

/* ── Confetti ── */
@keyframes confettiFall {
    0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(60px) rotate(360deg); opacity: 0; }
}
.confetti-burst {
    position: fixed; top: 30%; left: 0; right: 0;
    display: flex; justify-content: center; gap: 6px;
    pointer-events: none; z-index: 300;
}
.confetti-piece {
    width: 8px; height: 8px; border-radius: 2px;
    animation: confettiFall 1s ease forwards;
}