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

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #1b5e20;
    text-align: center;
    min-height: 100vh;
    padding: 15px;
}

.container {
    max-width: 760px;
    margin: 0 auto;
    background: white;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(30, 110, 50, 0.25);
    overflow: hidden;
}

header {
    background: #1b5e20;
    color: white;
    padding: 20px;
    font-size: 1.8em;
    font-weight: 600;
}

.intro {
    padding: 30px 20px;
    font-size: 1.25em;
    line-height: 1.5;
}

#game {
    padding: 20px 15px;
}

#challenge {
    font-size: 1.45em;
    margin: 10px 0 15px;
    font-weight: 600;
    color: #1b5e20;
    min-height: 70px;
}

.canvas-container {
    display: flex;
    justify-content: center;
    margin: 15px 0;
    background: #f1f8e9;
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

canvas {
    border: 5px solid #2e8b57;
    border-radius: 15px;
    max-width: 100%;
    height: auto;
    touch-action: none; /* Important pour mobile */
}

.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
}

button {
    background: #2e8b57;
    color: white;
    border: none;
    padding: 16px 28px;
    border-radius: 50px;
    font-size: 1.15em;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    max-width: 220px;
    box-shadow: 0 5px 15px rgba(46, 139, 87, 0.3);
}

button:hover {
    background: #1b5e20;
}

#status {
    font-size: 1.25em;
    margin: 15px 0;
    min-height: 30px;
}

#result {
    margin: 20px auto;
    max-width: 680px;
    font-size: 1.2em;
    line-height: 1.5;
    padding: 20px;
    border-radius: 18px;
    background: #e8f5e9;
}

.info {
    font-size: 1em;
    color: #2e8b57;
    margin-top: 15px;
}

.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-content {
    background: white;
    max-width: 90%;
    border-radius: 25px;
    padding: 35px 25px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.emoji {
    font-size: 4.5em;
    margin-bottom: 15px;
}

.hidden {
    display: none !important;
}

/* Optimisations mobile */
@media (max-width: 600px) {
    header { font-size: 1.65em; padding: 18px; }
    button { padding: 15px 20px; font-size: 1.1em; }
    #challenge { font-size: 1.3em; }
}