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

:root {
    --bg-gradient: linear-gradient(135deg, #1e1e2f 0%, #12121e 100%);
    --card-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-color: #ffd700;
    --text-color: #ffffff;
    --font-family: 'Outfit', sans-serif;
}

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

body {
    background: radial-gradient(circle at center, #2c3e50 0%, #000 100%);
    font-family: var(--font-family);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
}

#game-container {
    position: relative;
    height: 95vh;
    max-width: 100vw;
    aspect-ratio: 288 / 512;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    background: #000;
    border: 4px solid var(--glass-border);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

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

.hidden {
    opacity: 0;
    pointer-events: none;
}

.btn {
    background: var(--accent-color);
    color: #000;
    border: none;
    padding: 16px 32px;
    font-size: 1.4rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(255, 215, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

.btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.btn:active {
    transform: scale(0.95);
}

#score-display {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 2px 2px 0px #000;
    z-index: 5;
    pointer-events: none;
}

.title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-align: center;
    background: linear-gradient(to bottom, #fff, var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 20px;
}

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

#start-message img {
    animation: bounce 2s infinite ease-in-out;
}

/* --- Flappy Bird Ultra Premium Additions --- */

#hud-bar {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 15;
    pointer-events: none;
}

.hud-coins, #mute-btn {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 50px;
    font-weight: 700;
}

.hud-coins {
    padding: 6px 12px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#mute-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

#mute-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.15);
}

#mute-btn svg {
    width: 20px;
    height: 20px;
}

/* Shop and Skin Selector */
.shop-container {
    width: 90%;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 12px;
    margin: 15px 0 10px 0;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.05);
}

.shop-container h3 {
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 10px;
    color: var(--accent-color);
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.skin-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.skin-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.skin-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.skin-card.active {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.25);
}

.skin-preview {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-bottom: 6px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    position: relative;
}

.skin-preview.yellow { background: #fcd34d; border: 2px solid #d97706; }
.skin-preview.red { background: #ef4444; border: 2px solid #991b1b; box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
.skin-preview.neon { background: #06b6d4; border: 2px solid #ec4899; box-shadow: 0 0 8px rgba(6, 182, 212, 0.6); }
.skin-preview.gold { background: radial-gradient(circle, #ffe066, #b38600); border: 2px solid #ffd700; box-shadow: 0 0 10px rgba(255, 215, 0, 0.8); }

.skin-name {
    font-size: 0.65rem;
    font-weight: 700;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.skin-cost {
    font-size: 0.6rem;
    opacity: 0.7;
    font-weight: 700;
}

.skin-card.active .skin-cost {
    color: var(--accent-color);
    opacity: 1;
}

.skin-card.locked {
    filter: grayscale(0.5);
    opacity: 0.8;
}

.skin-card.locked:hover {
    filter: grayscale(0);
    opacity: 1;
}

/* Leaderboard */
.leaderboard-container {
    width: 90%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 8px 12px;
    margin-bottom: 15px;
}

.leaderboard-container h3 {
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    text-align: center;
    color: #a1a1aa;
    margin-bottom: 6px;
}

#leaderboard-list {
    list-style: none;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#leaderboard-list li {
    display: flex;
    justify-content: space-between;
    padding: 2px 4px;
    border-radius: 4px;
}

#leaderboard-list li:first-child {
    background: rgba(255, 215, 0, 0.08);
    color: var(--accent-color);
    font-weight: 700;
}

/* Game Over Stats */
.game-over-stats {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 20px 40px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.gameover-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-align: center;
    color: #ef4444;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.6), 0 0 20px rgba(239, 68, 68, 0.4);
    letter-spacing: 2px;
}

#final-score {
    font-size: 2rem;
    font-weight: 700;
}

#best-score {
    font-size: 1.2rem;
    opacity: 0.8;
}

.accent-text {
    color: var(--accent-color);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.hidden {
    display: none !important;
}

/* Custom Overlays styling override */
.overlay {
    padding: 15px;
    justify-content: center;
}

