/* GuessMyFamily v1.0 */
#gmf-app {
    max-width: 900px; margin: 0 auto; padding: 24px;
    font-family: Arial, sans-serif;
}
#gmf-home, #gmf-game, #gmf-summary {
    background: white; padding: 24px; border-radius: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
#gmf-app h1 { text-align: center; }

/* Boutons */
#gmf-app button {
    background: #84b060; color: white; border: none;
    padding: 12px 20px; border-radius: 12px;
    cursor: pointer; font-size: 16px; transition: all .2s;
}
#gmf-app button:hover  { background: #689046; }
#gmf-app button:active { background: #557a38; transform: scale(.98); }
#gmf-app button.disabled, #gmf-app button:disabled {
    background: #999 !important; cursor: not-allowed; opacity: .7; transform: none !important;
}
.gmf-stop-btn { background: #c62828 !important; margin-bottom: 16px; }
.gmf-stop-btn:hover { background: #8e0000 !important; }
.gmf-btn-row { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

/* Tooltip How to play */
.gmf-howtoplay-tooltip {
    position: relative; display: block;
    cursor: help; margin: 10px 0 16px; font-size: 14px; color: #555;
    text-align: center;
}
.gmf-howtoplay-label { user-select: none; }
.gmf-howtoplay-bubble {
    display: none; position: absolute;
    left: 50%; transform: translateX(-50%);
    top: calc(100% + 10px);
    width: min(400px, 90vw);
    background: #222; color: #fff;
    padding: 14px 16px; border-radius: 8px;
    font-size: 13px; line-height: 1.6;
    z-index: 999999; pointer-events: none; text-align: left;
    white-space: normal; word-wrap: break-word;
}
.gmf-howtoplay-tooltip:hover .gmf-howtoplay-bubble { display: block; }

/* Options accueil */
.gmf-option-block { margin: 16px 0; }
.gmf-radio { display: inline-block; margin-right: 16px; margin-top: 6px; cursor: pointer; }

/* Select */
#gmf-app select {
    width: 100%; padding: 12px; border-radius: 12px;
    border: 1px solid #ddd; font-size: 15px; margin-top: 12px;
}

/* Photo */
#gmf-photo {
    width: 100%; max-width: 600px;
    height: auto;
    border-radius: 16px;
    margin: 16px auto; display: block;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
}

/* Progress */
#gmf-progress {
    font-size: 16px; font-weight: bold; margin-bottom: 12px; color: #555;
}

/* Question */
#gmf-question-label {
    font-size: 18px; font-weight: bold; margin-top: 16px;
}

/* Feedback */
#gmf-feedback {
    font-size: 20px; font-weight: bold; margin-top: 16px;
}

/* Correction */
#gmf-correction {
    margin-top: 16px; padding: 16px;
    background: #f4f8fb; border-radius: 12px; font-size: 15px;
    line-height: 1.7;
}
#gmf-correction-text { margin-bottom: 16px; }

/* Arbre phylogénétique */
.gmf-tree { margin-top: 12px; }
.gmf-tree ul { list-style: none; padding: 0; margin: 0; }
.gmf-tree li {
    position: relative; padding: 5px 8px 5px 20px;
    margin: 2px 0; border-radius: 6px;
    font-size: 14px; border-left: 2px solid #ddd;
}
.gmf-tree li::before {
    content: ''; position: absolute;
    left: -2px; top: 50%; width: 10px; height: 2px;
    background: #ddd;
}
.gmf-tree-rank {
    display: inline-block; font-size: 10px; text-transform: uppercase;
    color: #888; background: #eee; padding: 1px 5px;
    border-radius: 4px; margin-right: 6px; vertical-align: middle;
}
/* Masquage/affichage */
.gmf-hidden { display: none !important; }

/* Bouton autre espèce — visible quand gmf-hidden est retiré */
#gmf-another-btn {
    margin: 8px auto;
    font-size: 14px;
    padding: 8px 16px;
}

.gmf-tree-sci   { color: #888; font-size: 12px; }
.gmf-tree-count { color: #888; font-size: 12px; font-style: normal; }
.gmf-tree-highlight {
    background: #e8f5e9 !important;
    border-left-color: #84b060 !important;
    font-weight: bold;
}
.gmf-tree-highlight::before { background: #84b060; }
.gmf-tree-species {
    background: #e3f2fd;
    border-left-color: #1565c0;
    font-style: italic;
}
.gmf-tree-species::before { background: #1565c0; }

/* Résumé */
#gmf-summary h2 { text-align: center; }
#gmf-restart-btn { display: block; margin: 0 auto 24px; }
.gmf-summary-item {
    display: flex; align-items: center; gap: 16px;
    padding: 12px 16px; border-radius: 12px;
    margin-bottom: 12px; color: white;
}
.gmf-good { background: #2e7d32; }
.gmf-bad  { background: #c62828; }
.gmf-summary-num { font-size: 18px; font-weight: bold; min-width: 32px; }
.gmf-summary-photo {
    width: 80px; height: 60px; object-fit: cover;
    border-radius: 8px; flex-shrink: 0;
}
.gmf-summary-info { font-size: 14px; line-height: 1.5; }
.gmf-summary-info em { opacity: .8; }

/* Mobile */
@media (max-width: 768px) {
    #gmf-app { padding: 8px; }
    #gmf-home, #gmf-game, #gmf-summary {
        padding: 12px; border-radius: 0; box-shadow: none; background: #f0f0f0;
    }
    #gmf-app button { width: 100%; display: block; box-sizing: border-box; margin-bottom: 8px; }
    .gmf-btn-row { flex-direction: column; }
    #gmf-photo { width: 100%; }
    .gmf-summary-item { flex-wrap: wrap; }
    .gmf-summary-photo { width: 60px; height: 45px; }
    .gmf-tree li { font-size: 13px; }
}
