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

.game-container {
    width: 95vw; /* 95% of viewport width */
    max-width: none; /* Remove max-width limitation */
    height: 95vh; /* 95% of viewport height */
    max-height: none; /* Remove max-height limitation */
    position: relative;
    overflow: hidden;
    margin: 0 auto; /* Center horizontally */
}

#game-area {
    width: 100%;
    height: 100%;
    background-color: #0077be; /* Deep ocean blue */
    position: relative;
    overflow: hidden;
}

/* Ocean waves */
.wave {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle at center, transparent 30%, #0077be 70%);
    opacity: 0.1;
    animation: wave 15s infinite linear;
    z-index: 0;
}

.wave:nth-child(2) {
    animation-delay: -5s;
    opacity: 0.07;
}

.wave:nth-child(3) {
    animation-delay: -10s;
    opacity: 0.05;
}

/* Island structure */
.island {
    position: absolute;
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    background-color: #8d7547; /* Sandy brown for island */
    border-radius: 40% 45% 43% 47% / 40% 43% 47% 45%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* Beach surrounding the island */
.beach {
    position: absolute;
    width: 94%;
    height: 94%;
    top: 3%;
    left: 3%;
    background-color: #f2d16b; /* Sand color */
    border-radius: 40% 45% 43% 47% / 40% 43% 47% 45%;
    z-index: 2;
}

/* Grassy area in the middle of the island */
.grass {
    position: absolute;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    background-color: #567d46; /* Green grass */
    border-radius: 40% 45% 43% 47% / 40% 43% 47% 45%;
    z-index: 3;
}

@keyframes wave {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    padding: 0;
    touch-action: none;
}


.plane-small, .plane-medium, .plane-large, .fast-plane, .slow-plane {
    /* Simple airplane shape from top view */
    clip-path: polygon(
        /* Nose */
        10% 50%,
        
        /* Top of fuselage to wing */
        20% 40%,
        
        /* Left wing */
        20% 20%,
        20% 0%,
        60% 40%,
        
        /* Back of fuselage */
        80% 40%,
        
        /* Tail */
        90% 50%,
        
        /* Bottom of fuselage */
        80% 60%,
        
        /* Right wing */
        50% 60%,
        70% 50%,
        20% 100%,
        
        /* Complete fuselage */
        20% 60%
    );
}

/* Color variations for different plane types */
.plane-small {
    background-color: #3498db; /* Blue */
}

.plane-medium {
    background-color: #2ecc71; /* Green */
}

.plane-large {
    background-color: #e74c3c; /* Red */
}

.fast-plane {
    background-color: #FF5733; /* Red-orange */
}

.slow-plane {
    background-color: #3498DB; /* Blue */
}

/* Aircraft styles */
.aircraft {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 10;
    transition: transform 0.2s ease;
}

.helicopter {
    background-color: #f1c40f; /* Yellow background */
    border-radius: 50%; /* Make it a circle */
    position: relative;
}

/* Create the spinning X with shorter lines */
.helicopter::after {
    content: '';
    position: absolute;
    top: -50%; /* Reduced from -100% */
    left: -50%; /* Reduced from -100% */
    width: 200%; /* Reduced from 300% */
    height: 200%; /* Reduced from 300% */
    background-image: 
        linear-gradient(45deg, transparent 49%, rgba(0, 0, 0, 0.7) 49%, rgba(0, 0, 0, 0.7) 51%, transparent 51%),
        linear-gradient(-45deg, transparent 49%, rgba(0, 0, 0, 0.7) 49%, rgba(0, 0, 0, 0.7) 51%, transparent 51%);
    animation: spin 0.5s linear infinite; /* Add spinning animation */
}

/* Define the spinning animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Add this to your CSS file */
.paused-animation {
    animation-play-state: paused !important;
    transition: none !important;
}


/* Pause button */
/* Updated Pause button to match theme */
#pause-button {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    background-color: rgba(30, 30, 50, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
    box-shadow: 0 0 10px rgba(0, 100, 255, 0.3);
}

#pause-button:hover {
    background-color: rgba(77, 166, 255, 0.8);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(77, 166, 255, 0.5);
}

.pause-icon, .play-icon {
    display: block;
    line-height: 1;
}

/* Popup styles */
/* Update the fullscreen popup styles */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background-color: rgba(30, 30, 50, 0.9);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 0 20px rgba(0, 100, 255, 0.5);
}

.popup h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #4da6ff;
    text-shadow: 0 0 10px rgba(77, 166, 255, 0.7);
}

.popup p {
    margin-bottom: 20px;
    color: white;
}

.popup button {
    background-color: #4da6ff;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 18px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.popup button:hover {
    background-color: #2a8ae8;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(77, 166, 255, 0.7);
}


.hidden {
    display: none;
}



/* Landing strips */
.landing-strip {
    position: absolute;
    width: 200px;
    height: 40px;
    background-color: #333;
    border: 2px solid #fff;
    z-index: 1;
}

.landing-pad {
    position: absolute;
    width: 60px;
    height: 60px;
    background-color: #333;
    border: 2px solid #fff;
    border-radius: 50%;
    z-index: 1;
}

/* Landing targets */
.landing-target {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.3);
    border: 2px dashed #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
}

/* Landing effect animation */
.landing-effect {
    animation: pulse 1s ease-out;
}

/* Update the button-container to accommodate the level display */
.button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* Style for the current level display */
.current-level {
    background-color: rgba(30, 30, 50, 0.9);
    color: #4da6ff;
    padding: 12px 20px;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 100, 255, 0.3);
    text-shadow: 0 0 5px rgba(77, 166, 255, 0.5);
}

#current-level {
    color: white;
    background-color: rgba(77, 166, 255, 0.7);
    padding: 3px 10px;
    border-radius: 5px;
    margin-left: 5px;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.warning-container {
    position: absolute;
    z-index: 1000;
    pointer-events: none;
}

.warning-indicator {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: white;
    pointer-events: none;
}

.warning-text {
    position: absolute;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    z-index: 9999; /* Ensure it's on top of everything */
    pointer-events: none;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
}

.fade-out {
    animation: fadeOut 0.5s forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes pulse {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.2);
    }
}

.collision-warning {
    position: absolute;
    border: 3px solid red;
    border-radius: 50%;
    animation: blink 0.3s infinite;
    z-index: 8;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.path {
    position: absolute;
    border: 2px dashed rgba(255, 255, 255, 0.7);
    pointer-events: none;
    z-index: 5;
}

#score-display {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(30, 30, 50, 0.9);
    color: #4da6ff;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 100, 255, 0.3);
    text-shadow: 0 0 5px rgba(77, 166, 255, 0.5);
    z-index: 50;
    transition: all 0.2s;
}

#score-display:hover {
    background-color: rgba(30, 30, 50, 0.95);
    box-shadow: 0 0 15px rgba(77, 166, 255, 0.5);
}

/* Update the game-over styles to match the welcome and pause menu styling */
#game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#game-over div {
    background-color: rgba(30, 30, 50, 0.9);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 100, 255, 0.5);
    max-width: 500px;
}

#game-over h2 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #4da6ff;
    text-shadow: 0 0 10px rgba(77, 166, 255, 0.7);
}

#game-over p {
    font-size: 20px;
    margin-bottom: 30px;
}

#restart-button {
    background-color: #4da6ff;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 18px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 20px;
}

#restart-button:hover {
    background-color: #2a8ae8;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(77, 166, 255, 0.7);
}


.hidden {
    display: none;
}

@keyframes landing-pulse {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.5); opacity: 1; }
    100% { transform: scale(1); opacity: 0.7; }
}

@keyframes explosion {
    0% { transform: scale(0.1); opacity: 0; }
    25% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.explosion {
    position: absolute;
    background-color: orange;
    border-radius: 50%;
    box-shadow: 0 0 30px 15px rgba(255, 165, 0, 0.7);
    animation: explosion 1s forwards;
    z-index: 20;
}

/* Update the runway styles */
#runway {
    position: absolute;
    width: 40px; /* Reduced from 60px */
    height: 300px; /* Reduced from 400px */
    background-color: #333333;
    z-index: 3;
}

.runway-markings {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.runway-centerline {
    position: absolute;
    left: 50%;
    top: 0;
    width: 4px;
    height: 100%;
    transform: translateX(-50%);
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 20px,
        white 20px,
        white 40px
    );
}

.runway-threshold {
    position: absolute;
    left: 0;
    width: 100%;
    height: 40px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
}

.runway-threshold-top {
    top: 10px;
}

.runway-threshold-bottom {
    bottom: 10px;
}

.threshold-stripe {
    width: 5px;
    height: 40px;
    background-color: white;
}

.runway-number {
    position: absolute;
    left: 50%;
    color: white;
    font-size: 16px;
    font-weight: bold;
    transform: translateX(-50%);
}

.runway-number-top {
    top: 70px;
    transform: translateX(-50%) rotate(180deg);
}

.runway-number-bottom {
    bottom: 50px;
}

.touchdown-zone {
    position: absolute;
    left: 0;
    width: 100%;
    height: 80px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0 calc(33% - 10px);
}

.touchdown-zone-top {
    top: 70px;
}

.touchdown-zone-bottom {
    bottom: 70px;
}

.touchdown-mark {
    width: 20px;
    height: 4px;
    background-color: white;
    margin: 7.5px 0;
}

.runway-lights {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.runway-lights-left {
    left: -5px;
}

.runway-lights-right {
    right: -5px;
}

.runway-lights::before,
.runway-lights::after,
.runway-lights span {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: yellow;
}

.approach-lights {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.approach-lights-top {
    top: -75px;
    height: 75px;
}

.approach-lights-bottom {
    bottom: -75px;
    height: 75px;
}

.approach-lights::before,
.approach-lights::after,
.approach-lights span {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: red;
    margin: 15px 0;
}

/* Path Arrow Styles */

/* Modify existing path segment style */
.path-segment {
    position: absolute;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.7);
    transform-origin: left center;
    pointer-events: none;
    z-index: 5;
}

/* Welcome Screen Styles */
.fullscreen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}

.welcome-content {
    max-width: 800px;
    padding: 30px;
    background-color: rgba(30, 30, 50, 0.9);
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 100, 255, 0.5);
}

.welcome-content h1 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #4da6ff;
    text-shadow: 0 0 10px rgba(77, 166, 255, 0.7);
}

.game-instructions {
    text-align: left;
    margin: 20px 0;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.game-instructions h2 {
    color: #4da6ff;
    margin-bottom: 10px;
}

.game-instructions ul {
    padding-left: 20px;
}

.game-instructions li {
    margin-bottom: 8px;
}

.primary-button {
    background-color: #4da6ff;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 18px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.primary-button:hover {
    background-color: #2a8ae8;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(77, 166, 255, 0.7);
}

.secondary-button {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 12px 24px;
    font-size: 18px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.level-selection {
    margin-top: 30px;
}

.level-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.level-button {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(77, 166, 255, 0.3);
    border: 2px solid rgba(77, 166, 255, 0.5);
}

.level-button.active {
    background-color: rgba(77, 166, 255, 0.7);
    border: 2px solid #4da6ff;
    box-shadow: 0 0 15px rgba(77, 166, 255, 0.7);
}

.level-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.level-button:not(.disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(77, 166, 255, 0.5);
}

/* Menu Content Styles */
.menu-content {
    background-color: rgba(30, 30, 50, 0.9);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 300px;
    box-shadow: 0 0 20px rgba(0, 100, 255, 0.5);
}

.menu-content h2 {
    color: #4da6ff;
    margin-bottom: 15px;
}

/* Hide elements */
.hidden {
    display: none !important;
}

/* Add these styles to your CSS file */

/* Landing strip highlight effect */
.landing-strip.highlight, .landing-pad.highlight {
    box-shadow: 0 0 15px 5px rgba(0, 255, 255, 0.7);
    animation: pulse 1.5s infinite;
}

/* Runway highlight should be elongated */
.landing-strip.highlight {
    border: 2px solid cyan;
}

/* Helipad highlight should be circular */
.landing-pad.highlight {
    border: 2px solid lime;
    border-radius: 50%;
}

/* Landing direction arrow */
/* Landing direction arrow */
/* Landing direction arrow */
.landing-arrow {
    position: absolute;
    width: 30px;
    height: 20px;
    background-color: rgb(164, 161, 161);
    /* This clip-path creates an arrow pointing to the left (opposite direction) */
    clip-path: polygon(0% 50%, 25% 0%, 25% 25%, 100% 25%, 100% 75%, 25% 75%, 25% 100%);
    /* Position from the left edge of the landing strip */
    left: 140px; /* This is a fixed position from the left edge */
    /* Center vertically by using top 50% and translating up by half the height */
    top: 50%;
    transform: translateY(-50%);
    /* Add dark gray outline using filter */
    filter: drop-shadow(0px 0px 1px #444);
    z-index: 2;
}



/* Landing arrows for planes (horizontal) */
.landing-arrow.plane-arrow {
    position: absolute;
    width: 20px;
    height: 10px;
    background-color: cyan;
    /* Arrow pointing to the left */
    clip-path: polygon(100% 50%, 30% 0, 30% 30%, 0% 30%, 0% 70%, 30% 70%, 30% 100%);
    transform: translate(-50%, -50%);
    animation: arrowPulse 1.5s infinite;
    z-index: 10;
    /* Center the arrow on the landing strip */
    top: 50%;
    left: 80%;
}

/* Landing arrows for helicopters (pointing inward) */
.landing-arrow.heli-arrow {
    position: absolute;
    width: 15px;
    height: 8px;
    background-color: lime;
    /* Base arrow shape - will be rotated to point inward */
    clip-path: polygon(100% 50%, 30% 0, 30% 30%, 0% 30%, 0% 70%, 30% 70%, 30% 100%);
    z-index: 10;
    animation: arrowPulse 1.5s infinite;
}

/* Specific positioning and rotation for each helipad arrow to point inward */
.landing-arrow.heli-arrow.top {
    bottom: 5px;
    left: 50%;
    transform: translate(-50%, 0) rotate(90deg);
}

.landing-arrow.heli-arrow.bottom {
    top: 5px;
    left: 50%;
    transform: translate(-50%, 0) rotate(-90deg);
}

.landing-arrow.heli-arrow.left {
    right: 5px;
    top: 50%;
    transform: translate(0, -50%) rotate(0deg);
}

.landing-arrow.heli-arrow.right {
    left: 5px;
    top: 50%;
    transform: translate(0, -50%) rotate(180deg);
}

/* Pulse animation for highlights and arrows */
@keyframes arrowPulse {
    0% { opacity: 0.7; scale: 0.8; }
    50% { opacity: 1; scale: 1.2; }
    100% { opacity: 0.7; scale: 0.8; }
}

/* Pulse animation for highlights and arrows */
@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Level timer styles */
.level-timer {
    position: absolute;
    top: 10px;
    right: 120px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    z-index: 100;
}

.time-warning {
    color: #ff5252;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Level complete overlay */
#level-complete-overlay {
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#level-complete-overlay .menu-content {
    background-color: #2c3e50;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    color: white;
    max-width: 400px;
}

#level-complete-overlay h2 {
    color: #2ecc71;
    margin-top: 0;
}

#next-level-button {
    margin-top: 20px;
    background-color: #2ecc71;
}

#next-level-button:hover {
    background-color: #27ae60;
}

.obstacle {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 0, 0, 0.2);
    border: 2px dashed #ff0000;
    z-index: 3;
    pointer-events: none;
}

.obstacle-stripes {
    position: absolute;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 0, 0, 0.3),
        rgba(255, 0, 0, 0.3) 10px,
        rgba(255, 0, 0, 0.1) 10px,
        rgba(255, 0, 0, 0.1) 20px
    );
    border-radius: 50%;
}

.no-fly-zone::before {
    content: "⚠️";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
}

.level-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    z-index: 10;
}

