/**
 * LudoQuiz - Stylesheet
 * MonsieurMike.be
 */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Patrick+Hand&display=swap');

.signature {
    font-family: 'Patrick Hand', 'Fredoka', cursive, sans-serif !important;
    font-size: 38px !important;
    color: #3498db !important;
    text-align: center !important;
    margin: 20px auto 15px auto !important;
    line-height: 1.25 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

:root {
    --ludo-font: 'Fredoka', 'Comic Sans MS', cursive, sans-serif;
    --ludo-yellow: #ffde59;
    --ludo-yellow-dark: #e5c542;
    --ludo-blue: #3498db;
    --ludo-blue-light: #62d0ff;
    --ludo-blue-dark: #2980b9;
    --ludo-coral: #ff7675;
    --ludo-orange: #ff914d;
    --ludo-green: #2ecc71;
    --ludo-green-dark: #27ae60;
    --ludo-purple: #9b59b6;
    --ludo-pink: #ff9ee5;
    --ludo-bg-card: #fffde7;
    --ludo-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    --ludo-radius: 20px;
    --ludo-radius-sm: 12px;

    /* Kahoot-like Answer Colors */
    --ans-red: #e74c3c;
    --ans-red-dark: #c0392b;
    --ans-blue: #2980b9;
    --ans-blue-dark: #1f618d;
    --ans-yellow: #f1c40f;
    --ans-yellow-dark: #d4ac0d;
    --ans-green: #27ae60;
    --ans-green-dark: #1e8449;
}

body.ludo-body {
    font-family: var(--ludo-font);
    background-color: #f7f9fc;
    color: #2c3e50;
    margin: 0;
    padding: 0;
}

/* Conteneur principal fluide et adapté à tout l'écran */
#corps {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.breadcrumbs {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.2rem 30px !important;
    margin: 0 !important;
    box-sizing: border-box;
}

.ludo-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 20px 30px 50px 30px;
    box-sizing: border-box;
}

/* En-tête LudoQuiz */
.ludo-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 3px solid var(--ludo-yellow);
    box-shadow: 0 6px 16px rgba(255, 222, 89, 0.35);
    border-radius: var(--ludo-radius);
    padding: 12px 24px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 12px;
}

.ludo-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #2c3e50;
}

.ludo-logo-icon {
    font-size: 32px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.ludo-brand-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--ludo-blue-dark);
    margin: 0;
}

.ludo-brand-subtitle {
    font-size: 13px;
    color: #7f8c8d;
    font-weight: 500;
}

.ludo-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Boutons d'action */
.ludo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--ludo-font);
    font-size: 16px;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: var(--ludo-radius-sm);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
    box-shadow: 0 4px 0 rgba(0,0,0,0.15);
    user-select: none;
}

.ludo-btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}

.ludo-btn-primary {
    background-color: var(--ludo-blue);
    color: white !important;
    box-shadow: 0 4px 0 var(--ludo-blue-dark);
}
.ludo-btn-primary:hover {
    background-color: #2980b9;
}

.ludo-btn-success {
    background-color: var(--ludo-green);
    color: white !important;
    box-shadow: 0 4px 0 var(--ludo-green-dark);
}
.ludo-btn-success:hover {
    background-color: #27ae60;
}

.ludo-btn-warning {
    background-color: var(--ludo-yellow);
    color: #333 !important;
    box-shadow: 0 4px 0 var(--ludo-yellow-dark);
}
.ludo-btn-warning:hover {
    background-color: #fdd835;
}

.ludo-btn-danger {
    background-color: var(--ans-red);
    color: white !important;
    box-shadow: 0 4px 0 var(--ans-red-dark);
}
.ludo-btn-danger:hover {
    background-color: #c0392b;
}

.ludo-btn-secondary {
    background-color: #ecf0f1;
    color: #2c3e50 !important;
    box-shadow: 0 4px 0 #bdc3c7;
}
.ludo-btn-secondary:hover {
    background-color: #e2e6ea;
}

.ludo-btn-sound {
    background: #ffffff;
    border: 2px solid #ddd;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Boîtes et Cartes */
.ludo-card {
    background: #ffffff;
    border-radius: var(--ludo-radius);
    padding: 26px 30px;
    margin-bottom: 25px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    width: 100%;
    box-sizing: border-box;
}

.ludo-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f1f2f6;
    padding-bottom: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.ludo-card-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--ludo-blue-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Zone d'entrée de code PIN pour enfants */
.pin-join-box {
    background: linear-gradient(135deg, #fffde7 0%, #fff9c4 100%);
    border: 4px solid var(--ludo-yellow);
    border-radius: 24px;
    padding: 35px 25px;
    text-align: center;
    max-width: 480px;
    margin: 20px auto 40px auto;
    box-shadow: 0 12px 30px rgba(255, 222, 89, 0.4);
}

.pin-join-box h2 {
    color: #d35400;
    font-size: 28px;
    margin: 0 0 10px 0;
}

.pin-join-box p {
    color: #555;
    font-size: 16px;
    margin-bottom: 22px;
}

.pin-input {
    width: 100%;
    max-width: 320px;
    padding: 14px 18px;
    font-family: var(--ludo-font);
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 6px;
    border: 3px solid #3498db;
    border-radius: 16px;
    background: #ffffff;
    color: #2c3e50;
    margin-bottom: 16px;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s;
}

.pin-input:focus {
    border-color: #2980b9;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.25);
}

.pseudo-input {
    width: 100%;
    max-width: 320px;
    padding: 12px 18px;
    font-family: var(--ludo-font);
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    border: 3px solid #2ecc71;
    border-radius: 16px;
    background: #ffffff;
    color: #2c3e50;
    margin-bottom: 20px;
    box-sizing: border-box;
    outline: none;
}

.avatar-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.avatar-opt {
    width: 48px;
    height: 48px;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 3px solid #e0e0e0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.avatar-opt:hover {
    transform: scale(1.15) rotate(5deg);
    border-color: #ff914d;
}

.avatar-opt.selected {
    border-color: #e67e22;
    background: #ffeaa7;
    transform: scale(1.18);
    box-shadow: 0 4px 10px rgba(230, 126, 34, 0.35);
}

/* Grille des quiz publics */
.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    width: 100%;
}

.quiz-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}

.quiz-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(52, 152, 219, 0.15);
    border-color: var(--ludo-blue);
}

.quiz-card-banner {
    padding: 16px;
    background: linear-gradient(135deg, #62d0ff 0%, #3498db 100%);
    color: white;
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quiz-card-body {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.quiz-card-desc {
    font-size: 14px;
    color: #636e72;
    margin: 8px 0 16px 0;
    flex-grow: 1;
    line-height: 1.4;
}

.quiz-card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.badge-tag {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    background: #f1f2f6;
    color: #2f3542;
}

.badge-blue { background: #e3f2fd; color: #1976d2; }
.badge-green { background: #e8f5e9; color: #2e7d32; }
.badge-orange { background: #fff3e0; color: #e65100; }
.badge-purple { background: #f3e5f5; color: #7b1fa2; }

/* Écran de Jeu (Play Screen) */
.game-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 10px;
}

.game-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 12px 20px;
    border-radius: 16px;
    border: 3px solid #ffde59;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    margin-bottom: 16px;
}

.player-info-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
}

.player-score-badge {
    background: #fff3cd;
    border: 2px solid #ffeeba;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    color: #856404;
    font-size: 18px;
}

/* Compte à rebours / Timer */
.timer-bar-container {
    width: 100%;
    height: 14px;
    background: #dfe6e9;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.timer-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    border-radius: 8px;
    transition: width 0.1s linear, background-color 0.3s;
}

.timer-bar-fill.warning {
    background: linear-gradient(90deg, #f39c12, #e67e22);
}

.timer-bar-fill.danger {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    animation: pulse-danger 0.5s infinite alternate;
}

@keyframes pulse-danger {
    from { opacity: 1; }
    to { opacity: 0.6; }
}

/* Question Box */
.question-box {
    background: #ffffff;
    border: 4px solid var(--ludo-blue);
    border-radius: 24px;
    padding: 30px 24px;
    text-align: center;
    margin-bottom: 25px;
    box-shadow: 0 8px 24px rgba(52, 152, 219, 0.18);
    position: relative;
}

.question-number {
    position: absolute;
    top: -16px;
    left: 24px;
    background: var(--ludo-blue);
    color: white;
    padding: 4px 16px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
}

.question-text {
    font-size: 26px;
    font-weight: 700;
    color: #2c3e50;
    margin: 8px 0 16px 0;
    line-height: 1.35;
}

.question-media {
    max-height: 240px;
    max-width: 100%;
    border-radius: 12px;
    margin: 10px auto 15px auto;
    display: block;
    object-fit: contain;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Grille de 4 Boutons Kahoot */
.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 25px;
}

@media (max-width: 650px) {
    .answers-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.ans-btn {
    display: flex;
    align-items: center;
    padding: 22px 20px;
    border-radius: 18px;
    font-family: var(--ludo-font);
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    border: none;
    text-align: left;
    transition: all 0.15s ease-in-out;
    box-shadow: 0 6px 0 rgba(0,0,0,0.2);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.ans-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.2);
}

.ans-shape {
    font-size: 26px;
    margin-right: 16px;
    display: inline-block;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.ans-text {
    flex-grow: 1;
    word-break: break-word;
}

/* Variantes Couleurs Kahoot */
.ans-0 {
    background-color: var(--ans-red);
    box-shadow: 0 6px 0 var(--ans-red-dark);
}
.ans-0:hover { background-color: #d63031; }

.ans-1 {
    background-color: var(--ans-blue);
    box-shadow: 0 6px 0 var(--ans-blue-dark);
}
.ans-1:hover { background-color: #0984e3; }

.ans-2 {
    background-color: var(--ans-yellow);
    color: #2c3e50 !important;
    box-shadow: 0 6px 0 var(--ans-yellow-dark);
}
.ans-2:hover { background-color: #f1c40f; }

.ans-3 {
    background-color: var(--ans-green);
    box-shadow: 0 6px 0 var(--ans-green-dark);
}
.ans-3:hover { background-color: #00b894; }

.ans-btn.selected {
    outline: 5px solid #ffffff;
    filter: brightness(1.1);
    transform: scale(0.98);
}

.ans-btn.disabled {
    pointer-events: none;
    opacity: 0.85;
}

.ans-btn.correct-highlight {
    outline: 6px solid #2ecc71;
    animation: pulse-correct 1s infinite alternate;
}

.ans-btn.wrong-highlight {
    opacity: 0.4;
    filter: grayscale(80%);
}

@keyframes pulse-correct {
    from { transform: scale(1); }
    to { transform: scale(1.02); }
}

/* Écran Feedback après réponse */
.feedback-overlay {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    margin: 20px 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.feedback-badge {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.feedback-correct {
    background: #d4edda;
    color: #155724;
    border: 3px solid #c3e6cb;
}

.feedback-wrong {
    background: #f8d7da;
    color: #721c24;
    border: 3px solid #f5c6cb;
}

.feedback-pts {
    font-size: 20px;
    font-weight: 700;
    color: #e67e22;
    margin: 8px 0;
}

.feedback-explanation {
    font-size: 16px;
    color: #555;
    background: #f8f9fa;
    padding: 14px;
    border-radius: 12px;
    margin-top: 14px;
    border-left: 4px solid var(--ludo-blue);
    text-align: left;
}

/* Podium & Leaderboard */
.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 15px;
    margin: 40px auto 30px auto;
    max-width: 600px;
    padding: 0 10px;
}

.podium-step {
    flex: 1;
    text-align: center;
    border-radius: 18px 18px 0 0;
    color: white;
    font-weight: 700;
    padding: 15px 10px;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.podium-avatar {
    font-size: 42px;
    margin-bottom: 6px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

.podium-name {
    font-size: 17px;
    word-break: break-all;
    margin-bottom: 4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.podium-score {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.podium-rank {
    font-size: 32px;
    font-weight: 800;
}

.podium-1 {
    height: 220px;
    background: linear-gradient(180deg, #f1c40f 0%, #d4ac0d 100%);
    order: 2;
    box-shadow: 0 0 25px rgba(241, 196, 15, 0.5);
}

.podium-2 {
    height: 170px;
    background: linear-gradient(180deg, #bdc3c7 0%, #95a5a6 100%);
    order: 1;
}

.podium-3 {
    height: 130px;
    background: linear-gradient(180deg, #e67e22 0%, #d35400 100%);
    order: 3;
}

/* Écran Hôte Enseignant (Host / Projecteur) */
.host-lobby {
    background: linear-gradient(135deg, #1e3799 0%, #0c2461 100%);
    color: white;
    border-radius: 24px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 12px 36px rgba(12, 36, 97, 0.4);
    margin-bottom: 30px;
}

.host-pin-display {
    font-size: 72px;
    font-weight: 800;
    letter-spacing: 8px;
    color: var(--ludo-yellow);
    text-shadow: 0 4px 12px rgba(0,0,0,0.3);
    margin: 15px 0;
    font-family: monospace;
}

.players-live-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 30px 0;
    min-height: 80px;
}

.player-live-chip {
    background: rgba(255, 255, 255, 0.95);
    color: #2c3e50;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0.3); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Tableaux d'administration */
.ludo-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 14px;
    overflow: hidden;
    margin-top: 15px;
    border: 2px solid #e1e8ed;
}

.ludo-table th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 700;
    padding: 14px 16px;
    text-align: left;
    border-bottom: 2px solid #e1e8ed;
}

.ludo-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #edf2f7;
    background: #ffffff;
    vertical-align: middle;
}

.ludo-table tr:last-child td {
    border-bottom: none;
}

.ludo-table tr:hover td {
    background-color: #f7fbfe;
}

/* Formulaires de création */
.ludo-form-group {
    margin-bottom: 18px;
}

.ludo-form-label {
    display: block;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 15px;
}

.ludo-input, .ludo-select, .ludo-textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--ludo-font);
    font-size: 16px;
    border: 2px solid #ccd1d9;
    border-radius: 12px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
    background: #ffffff;
}

.ludo-input:focus, .ludo-select:focus, .ludo-textarea:focus {
    border-color: var(--ludo-blue);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

/* Cartes de question dans l'éditeur */
.editor-q-card {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    transition: all 0.2s;
}

.editor-q-card:hover {
    border-color: var(--ludo-blue);
    background: #ffffff;
}

.editor-q-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.choice-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.choice-color-badge {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}
