/* ═══════════════════════════════════════════
   settings.css — Page paramètres ScorlyBoard
   ═══════════════════════════════════════════ */

#app {
    position: relative; z-index: 1;
    max-width: 480px; margin: 0 auto;
    padding: 0 0 40px;
}

/* ── Header ── */
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); display: flex; align-items: center; gap: 6px;
}
.header-title span { color: var(--accent); }
.header-sub { font-size: 0.7rem; color: var(--muted); margin-top: 2px; }

/* ── Sections ── */
.section {
    padding: 16px;
}
.section-title {
    font-size: 0.68rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--muted); margin-bottom: 4px;
}
.section-sub {
    font-size: 0.75rem; color: var(--muted);
    margin-bottom: 14px; opacity: 0.7;
}

/* ── Roster list ── */
.roster-list {
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 14px;
}
.roster-card {
    display: flex; align-items: center; gap: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.15s;
}
.roster-card:active { transform: scale(0.98); border-color: var(--accent); }
.roster-avatar {
    width: 40px; height: 40px; 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;
}
.roster-info { flex: 1; min-width: 0; }
.roster-name {
    font-weight: 600; font-size: 0.95rem;
    color: var(--text);
}
.roster-edit {
    font-size: 0.85rem; opacity: 0.4;
    transition: opacity 0.15s;
}
.roster-card:hover .roster-edit { opacity: 1; }

.roster-empty {
    text-align: center; padding: 24px 16px;
    color: var(--muted); font-size: 0.85rem;
    line-height: 1.5;
}

/* ── Add player form ── */
.add-player-form {
    display: flex; gap: 8px;
}
.add-player-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-player-form input:focus { border-color: var(--accent); }
.add-player-form input::placeholder { color: var(--muted); }
.btn-add {
    padding: 10px 18px;
    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;
    transition: opacity 0.15s;
    white-space: nowrap;
}
.btn-add:active { opacity: 0.85; }

/* ── Stats ── */
.stats-list {
    display: flex; flex-direction: column; gap: 10px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
}
.stat-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px;
}
.stat-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem; font-weight: 700;
    color: var(--text);
}
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.stat-item { text-align: center; }
.stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem; font-weight: 900;
    color: var(--text);
}
.stat-value.win { color: var(--accent); }
.stat-label {
    font-size: 0.65rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-top: 2px;
}
.stat-best-row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.stat-best-text {
    font-size: 0.78rem;
    color: var(--muted);
    flex: 1;
}
.stat-detail-btn {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--glass);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.stat-detail-btn:active { transform: scale(0.9); background: var(--glass-hover); }

/* ── Stat detail modal ── */
.sd-game {
    background: var(--glass-subtle);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
}
.sd-game-header {
    font-family: 'Playfair Display', serif;
    font-size: 0.95rem; font-weight: 700;
    color: var(--accent);
    margin-bottom: 10px;
}
.sd-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}
.sd-item {
    text-align: center;
    display: flex; flex-direction: column; align-items: center;
}
.sd-val {
    font-family: 'Playfair Display', serif;
    font-size: 1rem; font-weight: 900;
    color: var(--text);
}
.sd-val.win { color: var(--accent); }
.sd-lbl {
    font-size: 0.6rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.sd-scores {
    display: flex; justify-content: space-around;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 0.78rem; color: var(--muted);
}
.sd-scores strong { color: var(--text); font-weight: 700; }

/* ── Edit modal ── */
.edit-input {
    width: 100%;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    outline: none;
    margin-bottom: 16px;
}
.edit-input:focus { border-color: var(--accent); }

.color-picker {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 20px;
    justify-content: center;
}
.color-dot {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}
.color-dot:active { transform: scale(0.9); }
.color-dot.selected {
    border-color: var(--text);
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text);
}

.modal-confirm {
    width: 100%;
    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;
    margin-bottom: 10px;
}
.modal-confirm:active { opacity: 0.9; }

.edit-delete {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 85, 85, 0.3);
    background: rgba(255, 85, 85, 0.06);
    color: var(--red);
    font-family: 'DM Sans', sans-serif;
    font-weight: 600; font-size: 0.85rem;
    cursor: pointer;
    text-align: center;
}
.edit-delete:active { opacity: 0.8; }

/* ── About ── */
.info-section { opacity: 0.7; }
.about-text {
    font-size: 0.8rem; color: var(--muted);
    line-height: 1.6;
}
.about-text strong { color: var(--text); }

/* ── Modal (reuse style.css base) ── */
.modal-overlay .modal { position: relative; }

/* ═══════════════════════════════════════════
   STATS GÉNÉRALES
   ═══════════════════════════════════════════ */

/* ── Carte chart partagée ── */
.chart-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
}
.chart-title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem; font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
}
.chart-sub {
    font-size: 0.72rem; color: var(--muted);
    margin-bottom: 14px; line-height: 1.4;
}
.chart-detail-btn {
    display: block; width: 100%;
    margin-top: 14px; padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--glass-subtle);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem; font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.chart-detail-btn:active { transform: scale(0.97); background: var(--glass-hover); }

/* ── Podium Top 3 ── */
.podium-list {
    display: flex; flex-direction: column; gap: 10px;
    margin-bottom: 4px;
}
.podium-entry {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    background: var(--glass-subtle);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.podium-medal { font-size: 1.4rem; flex-shrink: 0; width: 28px; text-align: center; }
.podium-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Playfair Display', serif;
    font-weight: 900; font-size: 1rem;
    color: #1a0a2e; flex-shrink: 0;
}
.podium-avatar.sm { width: 30px; height: 30px; font-size: 0.85rem; }
.podium-info { flex: 1; min-width: 0; }
.podium-name {
    font-weight: 700; font-size: 0.95rem;
    color: var(--text);
}
.podium-score {
    font-size: 0.82rem; color: var(--accent);
    font-weight: 600; margin-top: 2px;
}
.podium-total { color: var(--muted); font-weight: 400; }

/* ── Top3 modal ── */
.top3-player-block {
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
}
.top3-player-block:last-child { border-bottom: none; margin-bottom: 0; }
.top3-player-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px;
}
.top3-player-name {
    flex: 1;
    font-family: 'Playfair Display', serif;
    font-size: 1rem; font-weight: 700;
    color: var(--text);
}
.top3-player-wins {
    font-size: 0.78rem; color: var(--accent);
    font-weight: 600;
}

/* ── Camembert ── */
.pie-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.pie-wrap canvas { flex-shrink: 0; }
.pie-legend {
    display: flex; flex-direction: column; gap: 7px;
    flex: 1; min-width: 100px;
}
.pie-legend-item {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.8rem;
}
.pie-legend-dot {
    width: 10px; height: 10px;
    border-radius: 50%; flex-shrink: 0;
}
.pie-legend-label { flex: 1; color: var(--text); }
.pie-legend-pct {
    color: var(--muted); font-size: 0.75rem;
    font-weight: 600;
}


/* ── Lien navigation vers Stats générales ── */
.stats-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    text-decoration: none;
    transition: all 0.15s;
}
.stats-nav-link:active { transform: scale(0.98); border-color: var(--accent); }
.stats-nav-icon { font-size: 1.6rem; flex-shrink: 0; }
.stats-nav-text { flex: 1; min-width: 0; }
.stats-nav-title {
    font-weight: 700; font-size: 1rem;
    color: var(--text);
    font-family: 'Playfair Display', serif;
}
.stats-nav-sub {
    font-size: 0.75rem; color: var(--muted);
    margin-top: 2px;
}
.stats-nav-arrow {
    font-size: 1.2rem; color: var(--muted);
    transition: transform 0.15s;
}
.stats-nav-link:active .stats-nav-arrow { transform: translateX(4px); }

/* ═══════════════════════════════════════════
   EXPORT / IMPORT
   ═══════════════════════════════════════════ */

.transfer-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.transfer-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
}

.transfer-divider {
    height: 1px;
    background: var(--border);
    margin: 0;
}

.transfer-info { flex: 1; min-width: 0; }

.transfer-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    font-family: 'Playfair Display', serif;
    margin-bottom: 3px;
}

.transfer-desc {
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.4;
}

.transfer-btn {
    flex-shrink: 0;
    padding: 9px 14px;
    border-radius: 12px;
    border: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.transfer-btn:active { transform: scale(0.95); }

.export-btn {
    background: var(--accent);
    color: #1a0a2e;
}
.import-btn {
    background: var(--glass);
    color: var(--text);
    border: 1px solid var(--border);
}

/* ── Import warning ── */
.import-warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(251, 113, 133, 0.1);
    border: 1px solid rgba(251, 113, 133, 0.3);
    border-radius: 12px;
    padding: 14px;
    margin: 12px 0 18px;
}
.import-warning-icon { font-size: 1.4rem; flex-shrink: 0; }
.import-warning-text {
    font-size: 0.82rem;
    color: var(--text);
    line-height: 1.55;
}
.import-warning-text strong { color: #fb7185; }

/* ── Info export import valide ── */
.data-hint {
    display: none; /* Masqué par défaut */
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 10px 14px;
    background: rgba(61, 220, 132, 0.15); /* Vert transparent */
    border: 1px solid rgba(61, 220, 132, 0.3);
    border-radius: 12px;
    color: #3ddc84; /* Vert Scorly */
    font-size: 0.85rem;
    font-weight: 500;
    animation: fadeIn 0.3s ease-out;
}

.data-hint--error {
    background: rgba(255, 85, 85, 0.1);
    border-color: rgba(255, 85, 85, 0.35);
    color: var(--red);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Loading overlay ── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 8, 32, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.loading-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(155, 89, 245, 0.2);
    border-top-color: var(--accent);
    animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════
   MODALE SUPPRESSION JOUEUR (style reset)
   ═══════════════════════════════════════════ */
.del-player-modal {
    background: var(--card);
    border-radius: 24px 24px 0 0;
    padding: 14px 18px 28px;
    position: fixed; bottom: 0; left: 0; right: 0;
    max-width: 480px; margin: 0 auto;
    z-index: 200;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.modal-overlay.open .del-player-modal {
    transform: translateY(0);
}
.del-modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem; font-weight: 900;
    color: var(--text);
    text-align: center;
    margin: 8px 0 4px;
}
.del-modal-sub {
    font-size: 0.78rem; color: var(--muted);
    text-align: center;
    margin-bottom: 16px;
}
.del-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
}
.del-option-btn {
    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);
    font-family: 'DM Sans', sans-serif;
    text-align: left;
    cursor: pointer;
    transition: all 0.18s;
    width: 100%;
}
.del-option-btn:active { transform: scale(0.97); }
.del-option-btn .ro-title { font-weight: 700; }
.del-option-btn:first-child {
    border-color: rgba(255, 255, 0, 0.35);
    background: rgba(255, 255, 0, 0.07);
}
.del-option-btn.danger {
    border-color: rgba(255, 85, 85, 0.4);
    background: rgba(255, 85, 85, 0.09);
}
.del-modal-cancel {
    display: block;
    margin: 14px 0 0;
    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;
}
.del-modal-cancel:active { transform: scale(0.97); }