:root {
    --primary-color: #FF6B35;
    --secondary-color: #004E89;
    --accent-color: #F7B801;
    --success-color: #06D6A0;
    --danger-color: #EF476F;
    --bg-gradient-start: #87CEEB;
    --bg-gradient-end: #E0F6FF;
    --text-dark: #1A1A2E;
    --text-light: #FFFFFF;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.game-container {
    width: 100%;
    max-width: 600px;
    height: 100vh;
    max-height: 800px;
    background: linear-gradient(180deg, #87CEEB 0%, #E0F6FF 100%);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.score-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--accent-color);
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(247, 184, 1, 0.3);
}

.score-display i {
    width: 24px;
    height: 24px;
    color: var(--text-dark);
}

.score-display span {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    min-width: 40px;
    text-align: center;
}

#gameCanvas {
    flex: 1;
    width: 100%;
    display: block;
    cursor: pointer;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.3s ease;
}

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

.overlay-content {
    background: white;
    padding: 50px 40px;
    border-radius: 30px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.5s ease;
}

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

.game-title, .game-over-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.title-icon {
    width: 64px;
    height: 64px;
    color: var(--primary-color);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.game-title h2, .game-over-title h2 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.game-over-title i {
    width: 64px;
    height: 64px;
    color: var(--danger-color);
}

.game-description {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.controls-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.control-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.control-item i {
    width: 32px;
    height: 32px;
    color: var(--secondary-color);
}

.control-item span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.game-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--danger-color) 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 50px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.4);
    transition: all 0.3s ease;
}

.game-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(255, 107, 53, 0.5);
}

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

.game-button i {
    width: 24px;
    height: 24px;
}

.high-score {
    margin-top: 25px;
    font-size: 16px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.high-score i {
    width: 20px;
    height: 20px;
    color: var(--accent-color);
}

.high-score span {
    font-weight: 700;
    color: var(--text-dark);
}

.final-score {
    background: linear-gradient(135deg, var(--accent-color) 0%, #FFD93D 100%);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.final-score i {
    width: 48px;
    height: 48px;
    color: var(--text-dark);
}

.score-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    opacity: 0.8;
    margin-bottom: 5px;
}

.score-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-dark);
}

.stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    background: #F5F5F5;
    padding: 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 140px;
}

.stat-item i {
    width: 32px;
    height: 32px;
    color: var(--success-color);
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.instructions {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 30px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.instruction-item i {
    width: 20px;
    height: 20px;
    color: var(--secondary-color);
}

.instruction-item span {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 500;
}

@media (max-width: 768px) {
    .game-container {
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .header {
        padding: 15px 20px;
    }

    .logo h1 {
        font-size: 20px;
    }

    .overlay-content {
        padding: 40px 30px;
    }

    .game-title h2, .game-over-title h2 {
        font-size: 28px;
    }

    .controls-info {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-height: 700px) {
    .overlay-content {
        padding: 30px 25px;
    }

    .game-title h2, .game-over-title h2 {
        font-size: 24px;
    }

    .title-icon {
        width: 48px;
        height: 48px;
    }
}