:root {
    --primary-font: 'Press Start 2P', 'Courier New', Courier, monospace;
    --background-color: #111;
    --text-color: white;
    --primary-accent: #ff00ff;
    --secondary-accent: #4dd0e1;
    --gold-color: gold;
    --danger-color: #ff5252;
    --success-color: #39ff14;
    --ui-background: rgba(0, 0, 0, 0.7);
    --modal-background: #222;
    --border-color: white;
}

body {
    font-family: var(--primary-font);
    text-align: center;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: var(--background-color);
    overflow: hidden; /* Prevents scrollbars on mobile */
}

#game-container {
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#board {
    background-image: url("./flappybirdbg.png");
    background-size: cover;
    background-position: center;
    display: block;
	width: 100%;  
    height: 100%;  
}

/* --- Loader --- */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: var(--text-color);
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--primary-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Screen Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* --- Main Menu --- */
#main-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--ui-background);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#main-menu.hidden {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

#main-menu h1 {
    font-size: 40px;
    margin-bottom: 10px;
    text-shadow: 0 0 10px var(--primary-accent), 0 0 20px var(--primary-accent), 4px 4px 5px #000;
}

#high-score-display {
    font-size: 16px;
    color: #f0e68c;
    margin-bottom: 25px;
}

#main-menu button {
    font-size: 20px;
    padding: 12px 30px;
    margin: 8px;
    cursor: pointer;
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-color);
    border-radius: 5px;
    font-family: inherit;
    transition: all 0.2s ease;
}

#main-menu button:hover {
    background: var(--border-color);
    color: black;
    transform: scale(1.05);
}

#main-menu button:active {
    transform: scale(0.95); /* Button press effect */
}

#main-menu .info {
    position: absolute;
    bottom: 10px;
    width: 100%;
    font-size: 10px;
    opacity: 0.8;
}

#main-menu .info p { margin: 4px; }
#main-menu .info a {
    color: var(--secondary-accent);
    text-decoration: none;
}
#main-menu .info a:hover { text-decoration: underline; }

/* --- Score & Game Over --- */
#score-display {
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    color: var(--text-color);
    text-align: center;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 1);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#score-display.active { opacity: 1; }
#current-score {
    font-size: 36px;
    color: var(--gold-color);
    display: block;
}

#game-over-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(-30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#main-menu:not(.hidden) #game-over-container.visible {
    opacity: 1;
    transform: translateY(0);
}

#game-over-message {
    font-size: 36px;
    color: var(--danger-color);
    text-shadow: 0 0 8px var(--danger-color);
}

#final-score {
    font-size: 24px;
    color: var(--gold-color);
    margin-top: 10px;
    font-weight: bold;
}

#new-highscore-message {
    font-size: 18px;
    color: var(--success-color);
    margin-top: 15px;
    text-shadow: 0 0 10px var(--success-color);
}

/* New High Score flashing animation */
@keyframes new-score-flash {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

.flash {
    animation: new-score-flash 1s ease-in-out infinite;
}

/* --- Pause Overlay --- */
#pause-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-color);
    font-size: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
}
#pause-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* --- About Modal --- */
#about-modal {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
#about-modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.modal-content {
    background: var(--modal-background);
    padding: 20px 30px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    width: 80%;
    max-width: 400px;
    position: relative;
}
.modal-content h2 {
    margin-top: 0;
    color: var(--primary-accent);
}
.modal-content h3 {
    margin-bottom: 5px;
}
.modal-content ul {
    list-style: none;
    padding: 0;
    text-align: left;
}
.modal-content ul li {
    margin-bottom: 8px;
}
#close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 30px;
    cursor: pointer;
    transition: transform 0.2s;
}
#close-modal:hover {
    transform: scale(1.2);
}
