@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;600;700&family=Caveat:wght@400;600;700&display=swap');

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

body {
    font-family: 'Caveat', 'Dancing Script', cursive, sans-serif;
    background: linear-gradient(135deg, #FFF9E8 0%, #c8e6c9 50%, #146669 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(139, 195, 74, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(104, 159, 56, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    background: #fffef7;
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(76, 175, 80, 0.15);
    max-width: 900px;
    width: 100%;
    text-align: center;
    animation: fadeIn 0.5s ease-in;
    border: 2px solid #c8e6c9;
    position: relative;
    z-index: 1;
}

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

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(232, 245, 233, 0.7);
    backdrop-filter: blur(5px);
    border-radius: 25px;
    z-index: 150;
    pointer-events: none;
}

.overlay.hidden {
    display: none;
}

.container.blurred .roulette-container,
.container.blurred .spin-button,
.container.blurred .prizes-list {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}

h1 {
    color: #146669;
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(85, 139, 47, 0.2);
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
}

.subtitle {
    color: #146669;
    font-size: 1.4em;
    margin-bottom: 30px;
    font-family: 'Caveat', cursive;
    font-weight: 600;
}

.roulette-container {
    margin: 40px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: filter 0.3s ease;
}

.roulette-wrapper {
    position: relative;
    width: 400px;
    height: 400px;
}

#rouletteCanvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.25);
    transition: transform 0.1s ease-out;
    border: 4px solid #c8e6c9;
}

.arrow {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid #146669;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(76, 175, 80, 0.4));
}

.spin-button {
    background: linear-gradient(135deg, #146669 0%, #146669 100%);
    color: white;
    border: 2px solid #146669;
    padding: 18px 50px;
    font-size: 1.8em;
    border-radius: 40px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(139, 195, 74, 0.3);
    transition: all 0.3s ease;
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
    margin: 30px 0;
    text-shadow: 1px 1px 2px rgba(85, 139, 47, 0.3);
    transition: all 0.3s ease, filter 0.3s ease;
}

.spin-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(139, 195, 74, 0.5);
    background: linear-gradient(135deg, #146669 0%, #146669 100%);
}

.spin-button:active:not(:disabled) {
    transform: translateY(-1px);
}

.spin-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.result {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in;
}

.result.hidden {
    display: none;
}

.result-content {
    background: #fffef7;
    padding: 50px;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(76, 175, 80, 0.3);
    max-width: 500px;
    width: 90%;
    animation: scaleIn 0.4s ease-out;
    border: 2px solid #c8e6c9;
}

@keyframes scaleIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.result-content h2 {
    color: #146669;
    font-size: 2.5em;
    margin-bottom: 20px;
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
}

.result-content h3 {
    color: #146669;
    font-size: 1.5em;
    margin-bottom: 15px;
    font-family: 'Caveat', cursive;
    font-weight: 600;
}

.prize-text {
    font-size: 2.2em;
    color: #146669;
    margin: 20px 0;
    font-weight: 700;
    font-family: 'Caveat', cursive;
}

.close-button {
    background: linear-gradient(135deg, #146669 0%, #146669 100%);
    color: white;
    border: 2px solid #146669;
    padding: 15px 40px;
    font-size: 1.4em;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 20px;
    font-family: 'Caveat', cursive;
    font-weight: 600;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(85, 139, 47, 0.3);
}

.close-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 195, 74, 0.4);
    background: linear-gradient(135deg, #146669 0%, #146669 100%);
}

.prizes-list {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 3px dashed #c8e6c9;
    transition: filter 0.3s ease;
}

.prizes-list h3 {
    color: #146669;
    font-size: 2em;
    margin-bottom: 20px;
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
}

.prizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.prize-item {
    background: linear-gradient(135deg, #c8e6c9 0%, #FFF9E8 100%);
    padding: 15px;
    border-radius: 15px;
    font-size: 1.3em;
    color: #146669;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(139, 195, 74, 0.2);
    border: 2px solid #146669;
    font-family: 'Caveat', cursive;
    transition: all 0.3s ease;
}

.prize-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(139, 195, 74, 0.3);
}

/* Modal d'inscription et de choix */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    animation: fadeIn 0.3s ease-in;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #fffef7;
    padding: 50px;
    border-radius: 30px;
    box-shadow: 0 25px 70px rgba(76, 175, 80, 0.4);
    max-width: 600px;
    width: 90%;
    animation: scaleIn 0.4s ease-out;
    border: 3px solid #146669;
    position: relative;
    z-index: 3001;
}

/* Modal de choix enfant/adulte */
.choice-modal-content {
    text-align: center;
}

.choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.choice-button {
    background: linear-gradient(135deg, #146669 0%, #146669 100%);
    color: white;
    border: 2px solid #146669;
    padding: 25px 40px;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(139, 195, 74, 0.3);
    transition: all 0.3s ease;
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(85, 139, 47, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 1.8em;
}

.choice-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(139, 195, 74, 0.5);
    background: linear-gradient(135deg, #146669 0%, #146669 100%);
}

.choice-button:active {
    transform: translateY(-1px);
}

.choice-icon {
    font-size: 2em;
}

.choice-text {
    font-size: 0.9em;
}

.adult-button {
    background: linear-gradient(135deg, #146669 0%, #146669 100%);
}

.adult-button:hover {
    background: linear-gradient(135deg, #146669 0%, #146669 100%);
}

.modal-content h2 {
    color: #146669;
    font-size: 2.5em;
    margin-bottom: 10px;
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
    text-align: center;
}

.modal-subtitle {
    color: #146669;
    font-size: 1.5em;
    margin-bottom: 30px;
    font-family: 'Caveat', cursive;
    text-align: center;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    color: #146669;
    font-size: 1.3em;
    margin-bottom: 10px;
    font-family: 'Caveat', cursive;
    font-weight: 600;
}

.form-group input[type="email"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #c8e6c9;
    border-radius: 15px;
    font-size: 1.1em;
    font-family: 'Caveat', cursive;
    color: #146669;
    background: #fff;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input[type="email"]:focus {
    outline: none;
    border-color: #146669;
    box-shadow: 0 0 10px rgba(139, 195, 74, 0.3);
}

.checkbox-group {
    margin: 30px 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 1.1em;
    line-height: 1.5;
    color: #146669;
    font-family: 'Caveat', cursive;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 12px;
    margin-top: 4px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #146669;
    flex-shrink: 0;
}

.error-message {
    display: none;
    color: #e57373;
    font-size: 1em;
    margin-top: 8px;
    font-family: 'Caveat', cursive;
}

.submit-button {
    width: 100%;
    background: linear-gradient(135deg, #146669 0%, #146669 100%);
    color: white;
    border: 2px solid #146669;
    padding: 18px 40px;
    font-size: 1.6em;
    border-radius: 40px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(139, 195, 74, 0.3);
    transition: all 0.3s ease;
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(85, 139, 47, 0.3);
    margin-top: 20px;
}

.submit-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(139, 195, 74, 0.5);
    background: linear-gradient(135deg, #146669 0%, #146669 100%);
}

.submit-button:active {
    transform: translateY(-1px);
}

/* Jeu des enfants : Suivi de contour (couture) */
.child-game-container {
    max-width: 1000px;
    position: relative;
}

.sewing-game-wrapper {
    position: relative;
    transition: filter 0.3s ease;
}

.sewing-game-wrapper.blurred {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}

.sewing-game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 40px 0;
    padding: 20px;
}

.sewing-start-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(232, 245, 233, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    border-radius: 25px;
    animation: fadeIn 0.3s ease-in;
}

.sewing-start-overlay.hidden {
    display: none;
}

.sewing-start-content {
    text-align: center;
    background: #fffef7;
    padding: 50px;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(76, 175, 80, 0.3);
    border: 3px solid #146669;
    max-width: 500px;
    width: 90%;
    animation: scaleIn 0.4s ease-out;
}

.sewing-start-content h2 {
    color: #146669;
    font-size: 2.5em;
    margin-bottom: 15px;
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
}

.sewing-start-content p {
    color: #146669;
    font-size: 1.5em;
    margin-bottom: 30px;
    font-family: 'Caveat', cursive;
}

#sewingCanvas {
    width: 100%;
    max-width: 400px;
    height: auto;
    aspect-ratio: 1;
    border: 3px solid #146669;
    border-radius: 15px;
    background: #fffef7;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    cursor: crosshair;
    touch-action: none; /* Empêcher le scroll sur mobile */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

#sewingCanvas:active {
    cursor: grabbing;
}

.progress-indicator {
    width: 100%;
    max-width: 400px;
    margin-top: 20px;
    position: relative;
}

.progress-bar {
    width: 0%;
    height: 30px;
    background: linear-gradient(135deg, #146669 0%, #146669 100%);
    border-radius: 15px;
    transition: width 0.3s ease;
    box-shadow: 0 4px 10px rgba(139, 195, 74, 0.3);
}

.progress-indicator span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #146669;
    font-weight: bold;
    font-family: 'Caveat', cursive;
    font-size: 1.5em;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    z-index: 1;
}

.precision-hint {
    font-size: 1em;
    color: #146669;
    margin-top: 10px;
    font-style: italic;
}

.precision-score {
    font-size: 1.5em;
    color: #146669;
    margin-top: 15px;
    font-family: 'Caveat', cursive;
    font-weight: 600;
}

.instructions {
    text-align: center;
    margin-top: 20px;
    font-size: 1.3em;
    color: #146669;
    font-family: 'Caveat', cursive;
    font-weight: 600;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .modal-content {
        padding: 30px 20px;
    }
    
    .modal-content h2 {
        font-size: 2em;
    }
    
    .modal-subtitle {
        font-size: 1em;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .roulette-wrapper {
        width: 300px;
        height: 300px;
    }
    
    .spin-button {
        padding: 15px 30px;
        font-size: 1.5em;
    }
    
    .result-content {
        padding: 30px;
    }
    
    .prize-text {
        font-size: 1.5em;
    }
    
    .child-game-container {
        padding: 15px;
    }
    
    .sewing-game-area {
        padding: 10px;
        margin: 20px 0;
    }
    
    #sewingCanvas {
        width: 100%;
        max-width: 100%;
        min-width: 280px;
    }
    
    .progress-indicator {
        width: 100%;
        max-width: 100%;
    }
    
    .sewing-start-content {
        padding: 30px 20px;
    }
    
    .sewing-start-content h2 {
        font-size: 2em;
    }
    
    .sewing-start-content p {
        font-size: 1.2em;
    }
    
    .instructions {
        font-size: 0.9em;
        padding: 0 10px;
    }
    
    .instructions p {
        font-size: 1em;
        margin: 5px 0;
    }
}

