:root {
    --primary-color: #FFD700;
    /* Gold for bird */
    --accent-color: #FF6B6B;
    /* Reddish for beak/accents */
    --sky-top: #4FACFE;
    --sky-bottom: #00F2FE;
    --pipe-color: #2ecc71;
    --pipe-border: #27ae60;
    --text-color: #ffffff;
    --font-family: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-family);
    overflow: hidden;
    background-color: #333;
    margin: 0;
    padding: 0;
}

.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(to bottom, var(--sky-top), var(--sky-bottom));
    overflow: hidden;
}

/* Background Elements */
.background {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle 20px at 10% 20%, rgba(255, 255, 255, 0.4) 0%, transparent 100%),
        radial-gradient(circle 40px at 80% 10%, rgba(255, 255, 255, 0.3) 0%, transparent 100%),
        radial-gradient(circle 30px at 40% 50%, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    z-index: 0;
}

/* Character Selection */
.character-selection {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.char-option {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, border 0.2s;
    border: 2px solid transparent;
    text-align: center;
}

.char-option:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

.char-option.selected {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.4);
}

.char-option .preview {
    font-size: 2rem;
    margin-bottom: 5px;
}

.char-option span {
    font-size: 0.9rem;
    font-weight: bold;
}

/* Player Base */
.player {
    position: absolute;
    left: 100px;
    top: 50%;
    z-index: 10;
    transform-origin: center;
    box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.1);
}

/* BIRD STYLE (Default) */
.player.bird {
    width: 40px;
    height: 28px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

.player.bird .eye {
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    border: 2px solid black;
    animation: blink 4s infinite;
}

.player.bird .eye.left {
    top: 2px;
    right: 22px;
    z-index: 10;
}

.player.bird .eye.right {
    top: 6px;
    right: 8px;
    z-index: 11;
}

.player.bird .eye::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 3px;
    width: 5px;
    height: 5px;
    background: black;
    border-radius: 50%;
}

.player.bird .beak {
    position: absolute;
    top: 12px;
    right: -8px;
    width: 12px;
    height: 10px;
    background: var(--accent-color);
    border-radius: 50% 50% 50% 0;
    border: 1px solid #c0392b;
}

.player.bird .wing {
    position: absolute;
    top: 14px;
    left: 5px;
    width: 18px;
    height: 10px;
    background: #fff;
    border-radius: 50% 50% 0 50%;
    opacity: 0.8;
}

/* PLANE STYLE */
.player.plane {
    width: 50px;
    height: 25px;
    background-color: #ecf0f1;
    /* White/Silver */
    border-radius: 10px 50% 50% 10px;
    /* Bullet shape */
    border: 2px solid #bdc3c7;
}

.player.plane .eye {
    /* Windows */
    position: absolute;
    top: 8px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: #3498db;
    border-radius: 50%;
    border: 1px solid #2980b9;
    box-shadow: -12px 0 0 #3498db;
    /* Second window */
}

.player.plane .beak {
    /* Propeller */
    position: absolute;
    top: 5px;
    right: -5px;
    width: 4px;
    height: 15px;
    background: #2c3e50;
    animation: spinProp 0.1s linear infinite;
}

.player.plane .wing {
    position: absolute;
    top: 10px;
    left: 15px;
    width: 20px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    transform: skewX(-20deg);
}

@keyframes spinProp {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* SPACESHIP STYLE */
.player.spaceship {
    width: 46px;
    height: 30px;
    background: #8e44ad;
    border-radius: 50% 50% 20% 20%;
    border-bottom: 4px solid #6c3483;
    box-shadow: 0 0 10px #8e44ad;
}

.player.spaceship .eye {
    /* Cockpit */
    position: absolute;
    top: -8px;
    left: 13px;
    width: 20px;
    height: 15px;
    background: #00d2d3;
    border-radius: 50% 50% 0 0;
    border: 2px solid #fff;
    opacity: 0.8;
}

.player.spaceship .beak {
    /* Lights */
    position: absolute;
    top: 12px;
    right: 5px;
    width: 6px;
    height: 6px;
    background: #f1c40f;
    border-radius: 50%;
    box-shadow: -15px 0 0 #f1c40f, -30px 0 0 #f1c40f;
    animation: blinkLights 0.5s infinite alternate;
}

.player.spaceship .wing {
    /* Thruster */
    position: absolute;
    bottom: 0;
    left: 15px;
    width: 16px;
    height: 10px;
    background: #e67e22;
    border-radius: 0 0 5px 5px;
    animation: thrust 0.1s infinite alternate;
}

@keyframes blinkLights {
    from {
        opacity: 0.5;
    }

    to {
        opacity: 1;
    }
}

@keyframes thrust {
    from {
        height: 10px;
        opacity: 0.8;
    }

    to {
        height: 15px;
        opacity: 1;
    }
}

/* Clouds */
.cloud {
    position: absolute;
    background: #fff;
    border-radius: 50px;
    z-index: 2;
    /* Behind everything but background */
    opacity: 0.8;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cloud::after,
.cloud::before {
    content: '';
    position: absolute;
    background: inherit;
    border-radius: 50%;
}

.cloud::after {
    width: 40px;
    height: 40px;
    top: -20px;
    left: 15px;
}

.cloud::before {
    width: 30px;
    height: 30px;
    top: -15px;
    left: 40px;
}

/* Coins */
.coin {
    position: absolute;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle at 30% 30%, #ffd700, #f1c40f);
    border: 3px solid #e67e22;
    border-radius: 50%;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    animation: spin 1s infinite alternate;
}

.coin::after {
    content: '$';
    font-size: 24px;
    font-weight: bold;
    color: #e67e22;
}

@keyframes spin {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}

/* Enemy Birds */
.enemy {
    position: absolute;
    width: 60px;
    height: 45px;
    background-color: #e74c3c;
    /* Red for danger */
    border-radius: 50%;
    z-index: 8;
    box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.2);
}

.enemy .eye {
    position: absolute;
    top: 8px;
    left: 10px;
    /* Eyes on left/front */
    width: 15px;
    height: 15px;
    background: white;
    border-radius: 50%;
    border: 2px solid black;
}

.enemy .eye::after {
    content: '';
    /* Angry pupil */
    position: absolute;
    top: 4px;
    right: 2px;
    width: 5px;
    height: 5px;
    background: black;
    border-radius: 50%;
}

.enemy .beak {
    position: absolute;
    top: 20px;
    left: -10px;
    width: 15px;
    height: 12px;
    background: #f39c12;
    border-radius: 50% 50% 0 50%;
    border: 1px solid #d35400;
}

.enemy .wing {
    position: absolute;
    top: 15px;
    right: 5px;
    width: 25px;
    height: 15px;
    background: #c0392b;
    border-radius: 50% 50% 50% 0;
}

/* Score */
.score-container {
    position: absolute;
    top: 10%;
    width: 100%;
    text-align: center;
    z-index: 20;
    pointer-events: none;
}

#score {
    font-size: 4rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Screens */
.start-screen,
.game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 30;
    color: white;
    text-align: center;
}

.hidden {
    display: none !important;
}

h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-shadow: 2px 2px 0 #000;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

button {
    padding: 12px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    background: var(--accent-color);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    font-family: var(--font-family);
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

/* Settings UI */
.settings-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 2rem;
    cursor: pointer;
    z-index: 100;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, background 0.2s;
    backdrop-filter: blur(5px);
}

.settings-icon:hover {
    transform: rotate(90deg);
    background: rgba(255, 255, 255, 0.4);
}

.settings-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
}

.settings-content {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    color: white;
}

.setting-item {
    margin: 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-item label {
    font-size: 1.2rem;
    font-weight: bold;
}

.toggle-btn {
    padding: 8px 16px;
    font-size: 1rem;
    background: var(--accent-color);
    border: none;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    width: 120px;
}

.close-btn {
    margin-top: 1rem;
    background: #555;
}

.close-btn:hover {
    background: #777;
}

input[type=range] {
    width: 120px;
    accent-color: var(--accent-color);
}

/* Status Overlay */
.status-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 150;
    pointer-events: none;
}

.status-overlay h2 {
    font-size: 3rem;
    color: white;
    text-shadow: 0 0 10px var(--accent-color);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* SDK Ad Protection - Ensure NO game elements appear above ads */
.game-container.ad-showing,
.game-container.ad-showing * {
    z-index: -1 !important;
    pointer-events: none !important;
}

/* Keep the game container itself visible but in background */
.game-container.ad-showing {
    position: relative;
    z-index: -1 !important;
}