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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 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 40px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.header {
    margin-bottom: 20px;
}

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

.score-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 15px;
    font-size: 1.2em;
    font-weight: bold;
}

.score {
    color: #28a745;
}

.next-fruit {
    color: #6f42c1;
}

.game-area {
    position: relative;
    margin: 20px auto;
    border: 3px solid #ff6b6b;
    border-radius: 15px;
    background: #fff5f5;
    overflow: hidden;
}

#gameCanvas {
    display: block;
    background: linear-gradient(to bottom, #e3f2fd, #fff);
    cursor: crosshair;
}

.game-line {
    position: absolute;
    top: 120px;
    left: 0;
    right: 0;
    height: 2px;
    background: #ff6b6b;
    opacity: 0.5;
    pointer-events: none;
}

.controls {
    margin-top: 20px;
}

#restartBtn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

#restartBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.instructions {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    color: #666;
    font-size: 0.9em;
    line-height: 1.5;
}

.instructions p {
    margin: 5px 0;
}

.game-over {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-over.hidden {
    display: none;
}

.game-over-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.game-over-content h2 {
    color: #ff6b6b;
    font-size: 2em;
    margin-bottom: 20px;
}

.game-over-content p {
    font-size: 1.3em;
    margin-bottom: 30px;
    color: #666;
}

#restartGameBtn {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#restartGameBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

@media (max-width: 768px) {
    .game-container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .score-container {
        font-size: 1em;
        padding: 8px 15px;
    }
    
    #gameCanvas {
        width: 100%;
        height: auto;
    }
}