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

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --bg-dark: #0f0f23;
    --bg-card: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #a0a0c0;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(245, 87, 108, 0.1) 0%, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    max-width: 600px;
    width: 100%;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease;
}

.header h1 {
    font-size: 3rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.score-panel {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.score-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.score-item .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.score-item .value {
    font-size: 2rem;
    font-weight: 700;
    background: var(--success-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-wrapper {
    position: relative;
    animation: fadeInUp 0.6s ease;
}

.next-fruit-indicator {
    position: absolute;
    top: 20px;
    right: -100px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    text-align: center;
    z-index: 10;
}

.next-fruit-indicator .label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .next-fruit-indicator {
        position: static;
        margin-bottom: 15px;
        display: inline-block;
    }
}

.game-container {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.game-line {
    position: absolute;
    top: 80px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #f5576c 20%, 
        #f5576c 80%, 
        transparent 100%);
    z-index: 5;
    opacity: 0.8;
    box-shadow: 0 0 10px rgba(245, 87, 108, 0.5);
}

.game-line::before {
    content: '⚠️ Warning Line';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #f5576c;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#gameCanvas {
    display: block;
    width: 100%;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
}

.cursor-guide {
    position: absolute;
    top: 20px;
    width: 2px;
    height: 40px;
    background: linear-gradient(180deg, 
        rgba(102, 126, 234, 0.8) 0%, 
        transparent 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 6;
}

.cursor-guide.active {
    opacity: 1;
}

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

.btn {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-secondary {
    background: var(--secondary-gradient);
    color: white;
}

.btn-large {
    font-size: 1.2rem;
    padding: 20px 40px;
    background: var(--success-gradient);
    color: white;
}

.btn-icon {
    font-size: 1.2rem;
}

.game-over-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.game-over-content {
    text-align: center;
    padding: 40px;
    background: var(--bg-card);
    border-radius: 20px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.4s ease;
}

.game-over-title {
    font-size: 3rem;
    font-weight: 800;
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 30px;
}

.final-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.final-score .label {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.final-score .value {
    font-size: 4rem;
    font-weight: 800;
    background: var(--success-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.instructions {
    margin-top: 30px;
    padding: 25px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid var(--border-color);
    animation: fadeInUp 0.6s ease 0.2s both;
}

.instructions h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.instructions ul {
    list-style: none;
}

.instructions li {
    padding: 10px 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

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

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .score-item {
        padding: 12px 20px;
    }

    .score-item .value {
        font-size: 1.5rem;
    }

    .game-over-title {
        font-size: 2rem;
    }

    .final-score .value {
        font-size: 3rem;
    }
}
