/* ========================================
   FLAPPY BIRD GAME STYLES
   Created by Shivanya
   ======================================== */

/* CSS Variables - Easy to change colors! */
:root {
    --bg-color: #70c5ce;           /* Sky blue background */
    --text-color: #ffffff;         /* White text */
    --accent-color: #f472b6;       /* Pink accent */
    --button-color: #8b5cf6;       /* Purple buttons */
}

/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Make icons filled instead of outlined */
.material-symbols-rounded {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Body styling - Starry Galaxy! */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Starry background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, white, transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 160px 120px, white, transparent),
        radial-gradient(2px 2px at 200px 50px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 250px 160px, white, transparent),
        radial-gradient(2px 2px at 300px 100px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 350px 60px, white, transparent),
        radial-gradient(2px 2px at 400px 140px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 50px 200px, white, transparent),
        radial-gradient(2px 2px at 100px 250px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 150px 300px, white, transparent),
        radial-gradient(2px 2px at 220px 280px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 280px 220px, white, transparent),
        radial-gradient(2px 2px at 320px 350px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 380px 300px, white, transparent),
        radial-gradient(2px 2px at 420px 250px, rgba(255,255,255,0.7), transparent),
        radial-gradient(3px 3px at 80px 400px, #f472b6, transparent),
        radial-gradient(3px 3px at 200px 380px, #60a5fa, transparent),
        radial-gradient(3px 3px at 350px 420px, #a78bfa, transparent),
        radial-gradient(2px 2px at 450px 380px, #22d3ee, transparent);
    background-repeat: repeat;
    background-size: 500px 500px;
    animation: twinkle 4s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: -1;
}

@keyframes twinkle {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Main container for everything */
.game-container {
    text-align: center;
    max-width: 500px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Header styles */
header {
    margin-bottom: 15px;
}

/* Back button to return to main portal */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 10px;
    transition: transform 0.2s;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.back-button:hover {
    transform: translateX(-5px);
}

/* Main title */
header h1 {
    font-size: 2rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 5px;
}

header h1 .material-symbols-rounded {
    color: #fbbf24;
}

/* Subtitle under the title */
.subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* Score board showing stats */
.score-board {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.score, .high-score {
    display: flex;
    align-items: center;
    gap: 5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.score {
    color: #fbbf24;
}

.high-score {
    color: #f472b6;
}

/* Bird mode toggle */
.bird-toggle {
    margin-bottom: 15px;
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #6b21a8, #9333ea);
    border: 3px solid #a855f7;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.5);
}

.mode-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(147, 51, 234, 0.7);
}

.mode-btn.active {
    background: linear-gradient(135deg, #ec4899, #f472b6);
    border-color: #f472b6;
    box-shadow: 0 0 25px rgba(236, 72, 153, 0.8);
    animation: glow 1s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 20px rgba(236, 72, 153, 0.6); }
    to { box-shadow: 0 0 30px rgba(236, 72, 153, 1); }
}

/* Unicorn button */
.mode-btn.unicorn {
    background: linear-gradient(135deg, #f472b6, #fb7185);
    border-color: #fda4af;
}

.mode-btn.unicorn:hover {
    box-shadow: 0 6px 20px rgba(244, 114, 182, 0.7);
}

.mode-btn.unicorn.active {
    background: linear-gradient(135deg, #fbbf24, #f472b6, #a78bfa);
    border-color: #fbbf24;
    box-shadow: 0 0 25px rgba(251, 191, 36, 0.8);
    animation: unicornGlow 1s ease-in-out infinite alternate;
}

@keyframes unicornGlow {
    from { box-shadow: 0 0 20px rgba(251, 191, 36, 0.6); }
    to { box-shadow: 0 0 30px rgba(244, 114, 182, 1); }
}

/* Main game area */
main {
    position: relative;
    display: inline-block;
    z-index: 2;
}

/* The canvas where the game happens */
#game-canvas {
    background: linear-gradient(180deg, #0f0c29 0%, #302b63 100%);
    border-radius: 15px;
    display: block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    max-width: 100%;
}

/* Overlay screens (start and game over) */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    gap: 12px;
    padding: 20px;
}

/* Hide overlay when not needed */
.overlay.hidden {
    display: none;
}

.overlay h2 {
    font-size: 2.5rem;
    color: #fbbf24;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.overlay p {
    color: #94a3b8;
    font-size: 1.1rem;
}

/* Difficulty buttons */
.difficulty-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.difficulty-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px 20px;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.difficulty-btn .material-symbols-rounded {
    font-size: 32px;
}

.difficulty-btn:hover {
    transform: scale(1.1);
}

/* Easy button - Green */
.difficulty-btn.easy {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    box-shadow: 0 4px 15px rgba(74, 222, 128, 0.4);
}

.difficulty-btn.easy:hover {
    box-shadow: 0 6px 20px rgba(74, 222, 128, 0.6);
}

/* Medium button - Orange */
.difficulty-btn.medium {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

.difficulty-btn.medium:hover {
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.6);
}

/* Hard button - Red */
.difficulty-btn.hard {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 4px 15px rgba(248, 113, 113, 0.4);
}

.difficulty-btn.hard:hover {
    box-shadow: 0 6px 20px rgba(248, 113, 113, 0.6);
}

/* Play button */
.play-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--button-color), #a78bfa);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.5);
}

/* Instructions */
.instructions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* Footer with credits */
footer {
    margin-top: 15px;
}

.created-by {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, var(--accent-color), #ec4899);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 450px) {
    header h1 {
        font-size: 1.5rem;
    }

    .difficulty-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .difficulty-btn {
        flex-direction: row;
        padding: 12px 20px;
    }

    .difficulty-btn .material-symbols-rounded {
        font-size: 24px;
    }
}
