/* === VARIABLES === */

:root {
    --primary: #AF0D21;           
    --primary-hover: #8A0A1A;     
    --bg-page: #1a1a1a;
    --bg-card: #FFFFFF;
    --text-main: #2D2D2D;
    --text-light: #6D6D6D;
    --success: #2E8540;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-lg: 0 15px 40px rgba(0,0,0,0.15);
}


/* === RESET === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

/* === CARTE PRINCIPALE === */
.game-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 450px;
    max-height: 95vh;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: cardAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardAppear {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* === HEADER & LOGO === */
.card-header {
    padding: 20px 20px 15px;
    text-align: center;
    background: linear-gradient(180deg, #FFFFFF 0%, #FDFCFB 100%);
    border-bottom: 1px solid rgba(198, 40, 40, 0.1);
}

.brand-container {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-image {
    width: 180px;
    height: auto;
    margin-bottom: 10px;
}

.logo-slogan {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 0.8rem;
    color: var(--primary);
    margin-top: 5px;
    letter-spacing: 0.5px;
}

.progress-container {
    width: 100%;
    height: 6px;
    background: rgba(198, 40, 40, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-hover) 100%);
    width: 10%;
    transition: width 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

/* === ÉTAPES === */
.step-container {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0;
}

.step-container.active {
    display: flex;
    opacity: 1;
    animation: stepFadeIn 0.4s ease;
}

@keyframes stepFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === TYPOGRAPHIE === */
h1 {
    font-family: 'Lora', serif;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.3;
    color: var(--text-main);
}

h2 {
    font-family: 'Lora', serif;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.3;
    color: var(--text-main);
}

p, .subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.step-indicator {
    font-family: 'Lora', serif;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.instruction-text {
    color: var(--text-light);
    font-size: 0.9rem;
    font-style: italic;
    margin-top: 20px;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* === BOUTON RETOUR === */
.btn-back {
    align-self: flex-start;
    background: rgba(198, 40, 40, 0.06);
    border: none;
    color: var(--primary);
    font-weight: 600;
    padding: 10px 16px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 10px;
    font-size: 0.9rem;
}

.btn-back:hover {
    background: rgba(198, 40, 40, 0.12);
    transform: translateX(-3px);
}

/* === TRIANGLE & NODES (DESIGN CARAMEL) === */
.triangle-container {
    position: relative;
    width: 100%;
    max-width: 320px;
    height: 300px;
    margin: 30px auto;
}

.triangle-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.triangle-svg path {
    fill: none;
    stroke: #D98C3A;
    stroke-width: 15;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 1;
    filter: drop-shadow(0 4px 4px rgba(217, 140, 58, 0.3));
    transition: all 0.3s ease;
}

/* === NODES (CERCLES) === */
.node {
    position: absolute;
    width: 115px;
    height: 115px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
}

.node:not(.locked):hover {
    transform: scale(1.08);
    filter: drop-shadow(0 8px 20px rgba(198, 40, 40, 0.25));
}

.node.locked {
    cursor: not-allowed;
    opacity: 0.7;
}

.node-ring {
    position: absolute;
    inset: -8px;
    border: 6px solid var(--primary);
    border-radius: 50%;
    background: white;
    transition: all 0.3s ease;
}

.node:not(.locked):hover .node-ring {
    border-width: 7px;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
}

.node-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: transform 0.4s ease;
}

.node:not(.locked):hover .node-img {
    transform: scale(1.05);
}

.node-lock {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    backdrop-filter: blur(3px);
    z-index: 3;
}

.node.completed .node-lock {
    display: none;
}

.node.completed::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    background: rgba(46, 133, 64, 0.9);
    border-radius: 50%;
    z-index: 3;
    animation: checkPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.node-1 { top: 10px; left: 15px; }
.node-2 { top: 10px; right: 15px; }
.node-3 { bottom: 10px; left: 50%; margin-left: -57.5px; }

/* === CADEAU CENTRAL === */
.center-node {
    position: absolute;
    top: 45%;
    left: 50%;
    margin-left: -50px;
    margin-top: -50px;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border: 5px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    cursor: pointer;
    box-shadow: 0 0 0 3px var(--primary), 0 10px 30px rgba(198, 40, 40, 0.3);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.center-node.locked {
    background: linear-gradient(135deg, #999 0%, #777 100%);
    box-shadow: 0 0 0 3px #999, 0 5px 15px rgba(0,0,0,0.15);
    cursor: not-allowed;
    opacity: 0.5;
}

.center-node:not(.locked):hover {
    transform: scale(1.15);
}

.center-node:not(.locked) {
    animation: giftPulse 2.5s infinite ease-in-out;
}

@keyframes giftPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.gift-icon {
    font-size: 2.8rem;
}

/* === BOUTONS === */
.btn-main {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 6px 20px rgba(198, 40, 40, 0.25);
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(198, 40, 40, 0.35);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 14px 32px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.btn-option {
    background: white;
    border: 2px solid #E5E5E5;
    color: var(--text-main);
    padding: 16px 20px;
    border-radius: 12px;
    width: 100%;
    margin-bottom: 12px;
    text-align: left;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-option:hover {
    border-color: var(--primary);
    background: rgba(198, 40, 40, 0.03);
    transform: translateX(4px);
}

/* === FORMULAIRE === */
.form-container {
    width: 100%;
}

.input-field {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #E5E5E5;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.08);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: left;
    cursor: pointer;
}

.checkbox-input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--primary);
}

.success-icon {
    background: linear-gradient(135deg, rgba(46, 133, 64, 0.15) 0%, rgba(46, 133, 64, 0.08) 100%);
    width: 85px;
    height: 85px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 2.5rem;
    animation: successPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPop {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* === JEU MEMORY === */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 25px;
    width: 100%;
    max-width: 400px;
}

.memory-card {
    aspect-ratio: 1;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-shadow: var(--shadow-sm);
}

.memory-card:hover:not(.flipped):not(.matched) {
    transform: scale(1.05);
}

.memory-card.flipped,
.memory-card.matched {
    transform: rotateY(180deg);
}

.memory-card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    backface-visibility: hidden;
    transform: rotateY(180deg);
    border: 3px solid var(--primary);
}

.memory-card-back {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    font-weight: 700;
    backface-visibility: hidden;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.memory-card.matched .memory-card-image {
    opacity: 0.8;
}

@keyframes matchPulse {
    0%, 100% { transform: rotateY(180deg) scale(1); }
    50% { transform: rotateY(180deg) scale(1.1); }
}

.memory-card.matched {
    animation: matchPulse 0.5s ease;
}

@media (max-width: 480px) {
    .memory-grid {
        gap: 10px;
        max-width: 100%;
    }
    .memory-card-back {
        font-size: 2rem;
    }
}

/* === QUIZ === */
.question-image {
    width: 100%;
    max-width: 280px;
    height: 180px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

/* === PRODUITS === */
#produitsContainer {
    width: 100%;
    margin-top: 20px;
}

.produit-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    border: 2px solid #E5E5E5;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.produit-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.produit-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #F5F5F5;
}

.produit-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.produit-info strong {
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
}

.produit-cta {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
}

/* === SCROLLBAR === */
.step-container::-webkit-scrollbar {
    width: 6px;
}

.step-container::-webkit-scrollbar-track {
    background: transparent;
}

.step-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

/* === RESPONSIVE MOBILE AMÉLIORÉ === */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .game-card {
        border-radius: 20px;
        max-height: 100vh;
    }

    .card-header {
        padding: 15px 20px 10px;
    }

    .logo-image {
        width: 150px;
    }

    .logo-slogan {
        font-size: 0.7rem;
    }

    .step-container {
        padding: 15px 10px;
    }

    h1 {
        font-size: 1.4rem;
        margin-bottom: 10px;
    }

    h2 {
        font-size: 1.2rem;
    }

    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 20px;
        padding: 0 10px;
    }

    .triangle-container {
        width: 100%;
        max-width: 300px;
        height: 280px;
        margin: 10px auto 30px;
    }

    .node {
        width: 95px;
        height: 95px;
    }

    .node-1 { top: 10px; left: 0; }
    .node-2 { top: 10px; right: 0; }
    .node-3 { bottom: 0; left: 50%; margin-left: -47.5px; }

    .center-node {
        width: 80px;
        height: 80px;
        margin-left: -40px;
        margin-top: -50px;
    }

    .gift-icon {
        font-size: 2.2rem;
    }

    .memory-grid {
        gap: 8px;
    }

    .word-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .answer-display {
        font-size: 1.4rem;
        letter-spacing: 4px;
    }

    .question-image {
        max-width: 100%;
        height: 160px;
    }
}

/* === MODAL NOTIFICATION CUSTOM === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-box {
    background: white;
    border-radius: 24px;
    padding: 40px 35px 35px;
    max-width: 90%;
    width: 380px;
    text-align: center;
    box-shadow: 0 25px 70px rgba(198, 40, 40, 0.4);
    transform: scale(0.85);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-icon {
    font-size: 4.5rem;
    margin-bottom: 22px;
    animation: modalIconPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    line-height: 1;
}

@keyframes modalIconPop {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    60% { transform: scale(1.1) rotate(10deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.modal-title {
    font-family: 'Lora', serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 14px;
    line-height: 1.2;
}

.modal-message {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 28px;
}

.btn-modal {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(198, 40, 40, 0.3);
    transition: all 0.3s ease;
    font-size: 1.05rem;
    min-width: 160px;
}

.btn-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(198, 40, 40, 0.4);
}

.btn-modal:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .modal-box {
        width: 340px;
        padding: 35px 28px 30px;
    }

    .modal-icon {
        font-size: 3.8rem;
    }

    .modal-title {
        font-size: 1.4rem;
    }

    .modal-message {
        font-size: 0.95rem;
    }
}

/* === AMÉLIORATION DES BOUTONS DE LETTRES (JEU 2) === */
.word-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
    max-width: 380px;
}

.word-btn {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    border: 3px solid var(--primary);
    color: var(--primary);
    width: 56px;
    height: 56px;
    border-radius: 16px;
    font-size: 1.6rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 4px 12px rgba(198, 40, 40, 0.15),
        inset 0 -2px 0 rgba(198, 40, 40, 0.1);
    position: relative;
    font-family: 'Lora', serif;
    letter-spacing: -1px;
}

.word-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 16px;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 0) 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.word-btn:hover::before {
    opacity: 1;
}

.word-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow:
        0 8px 20px rgba(198, 40, 40, 0.25),
        inset 0 -3px 0 rgba(198, 40, 40, 0.15);
    border-color: var(--primary-hover);
}

.word-btn:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow:
        0 3px 8px rgba(198, 40, 40, 0.2),
        inset 0 1px 0 rgba(198, 40, 40, 0.1);
}

.word-btn[style*="visibility: hidden"] {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.answer-display {
    min-height: 70px;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 10px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Lora', serif;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(198, 40, 40, 0.1);
}

.hint-timer {
    background: linear-gradient(135deg, rgba(198, 40, 40, 0.1) 0%, rgba(198, 40, 40, 0.05) 100%);
    color: var(--primary);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
    border: 2px solid rgba(198, 40, 40, 0.2);
    transition: all 0.3s ease;
}

.hint-timer.clickable {
    cursor: pointer;
    animation: hintPulse 1.5s infinite ease-in-out;
}

.hint-timer.clickable:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.05);
}

@keyframes hintPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(198, 40, 40, 0);
    }
}

.hint-text {
    background: linear-gradient(135deg, rgba(46, 133, 64, 0.15) 0%, rgba(46, 133, 64, 0.08) 100%);
    color: var(--success);
    padding: 14px 22px;
    border-radius: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    display: none;
    border: 2px solid rgba(46, 133, 64, 0.2);
    font-size: 0.95rem;
    line-height: 1.5;
}

.word-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 380px;
}

.word-buttons .btn-main,
.word-buttons .btn-secondary {
    flex: 1;
}

@media (max-width: 480px) {
    .word-btn {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
        border-width: 2.5px;
    }

    .answer-display {
        font-size: 1.6rem;
        letter-spacing: 6px;
        min-height: 60px;
    }
}
/* === IMAGE DU LOT À GAGNER (SHAKER COOKUT) === */
.prize-showcase {
    position: relative;
    width: 100%;
    max-width: 160px;
    margin: 0 auto 20px;
    border-radius: 16px;
    overflow: visible;
}

.prize-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(175, 13, 33, 0.15);
}

.prize-label {
    position: absolute;
    top: 6px;
    right: 6px;
    background: linear-gradient(135deg, #AF0D21 0%, #8A0A1A 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.8px;
    box-shadow: 0 4px 12px rgba(175, 13, 33, 0.4);
    text-transform: uppercase;
}

@media (max-width: 480px) {
    .prize-showcase {
        max-width: 140px;
        margin-bottom: 15px;
    }
    
    .prize-label {
        font-size: 0.65rem;
        padding: 4px 10px;
        top: 5px;
        right: 5px;
    }
}
