/* VokabelTrainer — optimisé tactile iPad (boutons ≥ 44px) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --accent:    #1D9E75;
    --accent-dk: #157a5b;
    --danger:    #e53e3e;
    --danger-lt: #fc8181;
    --warn:      #d69e2e;
    --neutral:   #718096;
    --success-lt:#68d391;
    --success:   #38a169;
    --bg:        #f7fafc;
    --card-bg:   #ffffff;
    --text:      #1a202c;
    --text-muted:#718096;
    --radius:    12px;
    --shadow:    0 2px 8px rgba(0,0,0,.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 17px;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ---- Navigation ---- */
.nav {
    background: #1a202c;
    padding: 0 16px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 56px;
    padding: 0 18px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 15px;
    border-radius: 6px;
}
.nav-link.active { background: var(--accent); color: #fff; }

/* ---- Layout ---- */
.main { max-width: 860px; margin: 28px auto; padding: 0 16px; }
h1 { font-size: 26px; font-weight: 700; margin-bottom: 20px; }
h2 { font-size: 20px; font-weight: 600; margin-bottom: 12px; }

/* ---- Boutons génériques ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border-radius: var(--radius);
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity .15s;
}
.btn:active { opacity: .75; }
.btn-primary   { background: var(--accent);  color: #fff; }
.btn-secondary { background: #e2e8f0;        color: var(--text); }
.btn-full      { width: 100%; }

/* ---- Accueil ---- */
.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-card.accent { background: var(--accent); color: #fff; }
.stat-value { display: block; font-size: 44px; font-weight: 700; line-height: 1; }
.stat-label { display: block; font-size: 14px; opacity: .8; margin-top: 6px; }

.tag-form {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.tag-form label { font-weight: 600; margin-bottom: 8px; display: block; }
.tag-form select {
    width: 100%;
    min-height: 44px;
    font-size: 16px;
    padding: 8px 12px;
    border: 1.5px solid #cbd5e0;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 12px;
}
.actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---- Boutons de session (accueil) ---- */
.session-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.session-row {
    display: flex;
    align-items: center;
    gap: 20px;
}
.btn-session {
    width: 160px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    border: 1.5px solid #ddd;
    cursor: pointer;
    background: #f0f0f0;
    text-align: center;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-session-grised {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.session-count {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

/* ---- Carte de révision ---- */
.progress-bar-wrap {
    background: #e2e8f0;
    border-radius: 99px;
    height: 6px;
    margin-bottom: 12px;
    overflow: hidden;
}
.progress-bar-fill {
    background: var(--accent);
    height: 100%;
    border-radius: 99px;
    transition: width .3s;
}
.progress-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
}

/* RECTO */
.card-recto {
    padding: 48px 24px;
    text-align: center;
}
.mot-display {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}
.mot-hint {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 36px;
}

/* VERSO */
.card-verso {
    padding: 32px 24px 24px;
    text-align: center;
}
.mot-verso-full {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-dk);
    margin-bottom: 10px;
}
.mot-pluriel {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.traduction {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 10px;
}
.source-ref {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* Bouton "Voir la réponse" */
.btn-voir {
    width: 100%;
    min-height: 64px;
    font-size: 18px;
    font-weight: 600;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s;
}
.btn-voir:active { background: var(--accent-dk); }

/* Grille des scores */
.scores-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 8px;
}
@media (min-width: 600px) {
    .scores-grid { grid-template-columns: repeat(6, 1fr); }
}

.btn-score {
    min-height: 64px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity .15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}
.btn-score span.score-num  { font-size: 22px; }
.btn-score span.score-lbl  { font-size: 11px; opacity: .85; margin-top: 2px; }
.btn-score:active { opacity: .7; }

.score-0 { background: #e53e3e; color: #fff; }
.score-1 { background: #fc8181; color: #fff; }
.score-2 { background: #f6ad55; color: #fff; }
.score-3 { background: #e2e8f0; color: var(--text); }
.score-4 { background: #68d391; color: #fff; }
.score-5 { background: #38a169; color: #fff; }

/* ---- Page Fin ---- */
.fin-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 48px 32px;
    text-align: center;
    box-shadow: var(--shadow);
}
.fin-icon { font-size: 64px; margin-bottom: 16px; }
.fin-count { font-size: 36px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }

/* ---- Gestion ---- */
.form-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 15px; }
.form-group input, .form-group select {
    width: 100%;
    min-height: 44px;
    font-size: 16px;
    padding: 8px 12px;
    border: 1.5px solid #cbd5e0;
    border-radius: 8px;
    background: #fff;
}
.form-group input:focus { outline: none; border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.mots-table { width: 100%; border-collapse: collapse; background: var(--card-bg);
    box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden; }
.mots-table th { background: #edf2f7; font-size: 13px; font-weight: 700;
    text-align: left; padding: 12px 16px; }
.mots-table td { padding: 12px 16px; border-top: 1px solid #e2e8f0; font-size: 15px; }
.mots-table tr:last-child td { border-bottom: none; }
.badge-article { background: #bee3f8; color: #2b6cb0;
    border-radius: 6px; padding: 2px 8px; font-size: 13px; font-weight: 600; }

.placeholder { color: var(--text-muted); font-style: italic; }

/* ---- Indice (phrase_contexte) ---- */
.btn-indice {
    display: inline-block;
    margin: 8px auto 12px;
    padding: 6px 18px;
    min-height: 36px;
    font-size: 15px;
    background: #edf2f7;
    color: var(--text-muted);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.btn-indice:active { opacity: .7; }

.indice-box {
    margin: 8px 24px 16px;
    padding: 12px 16px;
    background: #fffbeb;
    border-left: 3px solid var(--warn);
    border-radius: 8px;
    font-size: 15px;
    font-style: italic;
    color: #744210;
    text-align: left;
    /* transition sans opacity:0 — safe sur Safari iOS */
    animation: none;
}

/* ---- Conjugaison (verso verbe) ---- */
.conjugaison-box {
    margin: 12px 24px 16px;
    padding: 12px 16px;
    background: #ebf8ff;
    border-left: 3px solid #4299e1;
    border-radius: 8px;
    text-align: left;
}
.conj-row {
    display: flex;
    gap: 12px;
    padding: 3px 0;
    font-size: 15px;
}
.conj-label {
    font-weight: 600;
    min-width: 100px;
    color: #2b6cb0;
}
.conj-val { color: var(--text); }

.badge-tag {
    display: inline-block;
    background: #e9d8fd;
    color: #553c9a;
    border-radius: 6px;
    padding: 2px 7px;
    font-size: 12px;
    font-weight: 600;
    margin: 1px 2px;
}

/* Petits boutons action (edit/delete dans tableau) */
.btn-sm {
    min-height: 36px;
    padding: 0 12px;
    font-size: 14px;
    border-radius: 8px;
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:active { opacity: .75; }
.actions-cell { white-space: nowrap; }
