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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
    max-width: 900px;
    width: 100%;
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.scoreboard {
    display: flex;
    justify-content: center;
    gap: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px;
    border-radius: 10px;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-item .label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-item .value {
    color: white;
    font-size: 2em;
    font-weight: bold;
    margin-top: 5px;
}

.game-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}

#gameCanvas {
    border: 3px solid #667eea;
    border-radius: 10px;
    width: 100%;
    max-width: 1000px;
    height: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    touch-action: none; /* Empêche le zoom et le scroll sur mobile */
    -webkit-tap-highlight-color: transparent; /* Enlève le highlight sur iOS */
}

.timing-zone {
    margin-top: 20px;
    width: 100%;
    max-width: 600px;
}

.timing-bar {
    position: relative;
    width: 100%;
    height: 40px;
    background: linear-gradient(to right, #ff6b6b, #ffd93d, #6bcf7f, #ffd93d, #ff6b6b);
    border-radius: 20px;
    border: 3px solid #333;
    overflow: hidden;
}

.timing-indicator {
    position: absolute;
    width: 4px;
    height: 100%;
    background: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.5);
    left: 0;
    transition: left 0.05s linear;
}

.perfect-zone {
    position: absolute;
    width: 20%;
    height: 100%;
    left: 40%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px dashed white;
    pointer-events: none;
}

.timing-text {
    text-align: center;
    margin-top: 10px;
    font-size: 1.1em;
    color: #667eea;
    font-weight: bold;
}

.feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2em;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    text-align: center;
    white-space: pre-line;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 30px;
    border-radius: 12px;
    line-height: 1.4;
}

.feedback.show {
    opacity: 1;
}

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

.btn-primary, .btn-secondary {
    padding: 15px 40px;
    font-size: 1.2em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-primary:active, .btn-secondary:active {
    transform: translateY(0);
}

.instructions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid #667eea;
}

.instructions h3 {
    color: #333;
    margin-bottom: 10px;
}

.instructions p {
    color: #666;
    margin: 8px 0;
    line-height: 1.6;
}

.instructions strong {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

@keyframes slideIn {
    from {
        transform: translate(-50%, -50%) scale(0);
    }
    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

.feedback.show {
    animation: slideIn 0.3s ease-out;
}

