:root {
    --primary: #f25346;
    --primary-dark: #d6483b;
    --secondary: #68c3c0;
    --bg-dark: #0c1445;
    --text-gold: #d1b790;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-heavy: rgba(255, 255, 255, 0.2);
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    --neon-blue: #00f2ff;
    --neon-gold: #ffd700;
    --ui-btn-bg: #f9e3c0;
    --ui-btn-border: #d1b790;
    --ui-btn-text: #59332e;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
}

.ui-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0c1445 0%, #1a2a6c 100%);
    transition: var(--transition);
    opacity: 1;
    visibility: visible;
}

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

/* Intro Screen */
.intro-screen {
    background: #000;
    overflow: hidden;
}

.screen-1 {
    background-position: 0% 0%;
}

.screen-2 {
    background-position: 0% 0%;
}

.screen-3 {
    background-position: 0% 0%;
}

.intro-content {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.menu-container {
    position: relative;
    z-index: 10;
}

.intro-text {
    color: var(--white);
    font-size: 1.5rem;
    margin-top: 10px;
    opacity: 0.8;
}

.intro-previews {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.logo-main {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3rem, 10vw, 6rem);
    color: var(--text-gold);
    margin: 0;
    letter-spacing: -2px;
}

.logo-main span {
    display: block;
    font-size: 0.3em;
    font-style: italic;
    margin-bottom: -0.2em;
    opacity: 0.8;
}

@media (max-width: 600px) {
    .logo-main {
        font-size: 3.5rem;
    }
}

.loader-container {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 40px auto;
    overflow: hidden;
}

.loader-bar {
    width: 0%;
    height: 100%;
    background: var(--text-gold);
    box-shadow: 0 0 15px var(--text-gold);
    transition: width 5s linear;
}

.dev-credit {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.dev-credit span {
    color: var(--white);
    font-weight: 700;
}

.skip-btn {
    position: absolute;
    bottom: 40px;
    right: 40px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    transition: var(--transition);
}

.skip-btn:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Main Menu */
.menu-bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(104, 195, 192, 0.1) 0%, transparent 70%);
    animation: bgPulse 8s ease-in-out infinite;
    pointer-events: none;
}

.menu-container {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    width: 95%;
    max-width: 480px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    z-index: 101;
}

.menu-title {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    color: var(--text-gold);
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(209, 183, 144, 0.5);
}

.animated-title {
    animation: titlePulse 3s ease-in-out infinite;
}

.high-score-display {
    color: var(--secondary);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 30px;
    letter-spacing: 2px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-btn {
    background: var(--ui-btn-bg);
    border: 2px solid var(--ui-btn-border);
    color: var(--ui-btn-text);
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 3px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 0 var(--ui-btn-border);
    text-transform: uppercase;
}

.menu-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--ui-btn-border);
}

.menu-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--ui-btn-border);
}

.menu-btn.primary {
    background: #f25346;
    color: white;
    border-color: #d6483b;
    box-shadow: 0 4px 0 #d6483b;
}

.menu-btn.primary:hover {
    background: #ff6b5e;
    box-shadow: 0 6px 0 #d6483b;
}

.menu-btn.secondary {
    background: var(--secondary);
    color: white;
    border-color: #50b0ad;
    box-shadow: 0 4px 0 #50b0ad;
}

.footer-credit a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
}

.footer-credit a:hover {
    color: var(--white);
    text-shadow: 0 0 10px var(--secondary);
}

.skip-btn {
    margin-top: 30px;
    padding: 12px 35px;
    background: var(--text-gold);
    color: var(--bg-dark);
    font-weight: 700;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 20px rgba(255, 215, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.skip-btn:hover {
    transform: scale(1.05);
    background: #fff;
}

.footer-credit {
    position: absolute;
    bottom: 30px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
    letter-spacing: 1px;
}

/* Overlays */
.overlay {
    position: fixed;
    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;
    transition: var(--transition);
}

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

.overlay-content {
    background: #1e2a5a;
    width: 95%;
    max-width: 550px;
    max-height: 85vh;
    padding: 30px;
    border-radius: 30px;
    position: relative;
    color: white;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--text-gold) transparent;
}

.overlay-content::-webkit-scrollbar {
    width: 6px;
}

.close-overlay {
    position: absolute;
    top: 25px;
    right: 25px;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition);
}

.close-overlay:hover {
    opacity: 1;
    transform: rotate(90deg);
}

/* Options Styles */
.option-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.planes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.plane-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    position: relative;
}

.plane-item.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.plane-item.active {
    opacity: 0.5;
    cursor: not-allowed;
}

.plane-item.active {
    content: 'ðŸ”’';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.8rem;
}

.plane-preview {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    border-radius: 8px;
}

.plane-preview.red {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.plane-preview.blue {
    background: var(--secondary);
    box-shadow: 0 0 10px var(--secondary);
}

.plane-preview.green {
    background: #4caf50;
    box-shadow: 0 0 10px #4caf50;
}

.plane-preview.gold {
    background: var(--neon-gold);
    box-shadow: 0 0 10px var(--neon-gold);
}

.plane-preview.neon {
    background: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue);
}

.plane-preview.phantom {
    background: #555;
    box-shadow: 0 0 10px #000;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--secondary);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

/* Push Button (Top Right) */
.push-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--glass-heavy);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.push-btn:hover {
    background: var(--white);
}

.push-btn .bar {
    width: 25px;
    height: 3px;
    background: var(--white);
    border-radius: 2px;
    transition: var(--transition);
}

.push-btn:hover .bar {
    background: var(--bg-dark);
}

/* Pause Menu */
#pause-menu .overlay-content {
    text-align: center;
}

/* Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes imageFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes titlePulse {

    0%,
    100% {
        transform: scale(1);
        text-shadow: 0 0 20px rgba(209, 183, 144, 0.5);
    }

    50% {
        transform: scale(1.05);
        text-shadow: 0 0 40px rgba(209, 183, 144, 0.8);
    }
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.game-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.game-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.1);
}

.game-card img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 15px;
}

.game-card h3 {
    margin: 0 0 10px;
    color: var(--text-gold);
}

/* Animations */
@keyframes bgPulse {

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

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

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

    50% {
        transform: scale(1.1);
    }

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

/* Professional Unlock Cards */
.unlock-card {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid var(--secondary);
    border-radius: 25px;
    padding: 20px 40px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 2000;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    min-width: 300px;
}

.unlock-card.show {
    top: 40px;
}

.unlock-card.plane {
    border-color: var(--text-gold);
}

.unlock-icon {
    font-size: 2.5rem;
    animation: levelUpPop 0.8s ease-out;
}

.unlock-content h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--secondary);
    letter-spacing: 2px;
}

.unlock-card.plane h3 {
    color: var(--text-gold);
}

.unlock-content p {
    margin: 5px 0 0;
    font-weight: 300;
    opacity: 0.8;
    font-size: 1rem;
}

/* Detailed Plane Selection Item */
.plane-item-large {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
}

.plane-item-large:hover:not(.locked) {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(10px);
    border-color: var(--secondary);
}

.plane-item-large.active {
    border-color: var(--secondary);
    background: rgba(104, 195, 192, 0.1);
}

.plane-preview-large {
    width: 80px;
    height: 80px;
    border-radius: 15px;
}

.plane-info h3 {
    margin: 0;
    color: var(--white);
    font-size: 1.2rem;
}

.plane-info p {
    margin: 5px 0 0;
    font-size: 0.9rem;
    opacity: 0.6;
}

.plane-item-large.locked {
    filter: grayscale(1) opacity(0.5);
    cursor: not-allowed;
}

.lock-icon {
    position: absolute;
    right: 20px;
    font-size: 1.5rem;
}

/* Mobile Responsive */
@media screen and (max-width: 640px) {

    .menu-container,
    .overlay-content {
        padding: 30px;
        border-radius: 30px;
    }

    .menu-title {
        font-size: 2.2rem;
    }

    .overlay-content h2 {
        font-size: 1.8rem;
    }

    .planes-grid {
        grid-template-columns: 1fr;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .intro-img {
        width: 90%;
    }

    .intro-previews {
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 10px;
    }

    .menu-buttons {
        gap: 8px !important;
    }

    .overlay-content {
        max-height: 80vh !important;
    }
}
/* Mobile Responsive */
@media screen and (max-width: 600px) {

    .menu-container,
    .overlay-content {
        padding: 30px;
        border-radius: 30px;
    }

    .menu-title {
        font-size: 2.2rem;
    }

    .overlay-content h2 {
        font-size: 1.8rem;
    }

    .planes-grid {
        grid-template-columns: 1fr;
    }
}

/* --- PREMIUM ANIMATIONS & TWEAKS --- */

/* 1. Legendary Title Glow Pulse */
@keyframes legendaryGlow {
    0%, 100% { text-shadow: 0 0 10px rgba(209, 183, 144, 0.4), 0 0 20px rgba(209, 183, 144, 0.2); }
    50% { text-shadow: 0 0 25px rgba(209, 183, 144, 0.8), 0 0 45px rgba(209, 183, 144, 0.4); }
}

.logo-main, .menu-title {
    animation: legendaryGlow 3s ease-in-out infinite;
    letter-spacing: 2px;
}

/* 2. Entrance Animation for Menu Items */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Applying Staggered Entrance to Buttons */
.menu-buttons .menu-btn {
    opacity: 0;
    animation: fadeInUp 0.7s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.menu-buttons .menu-btn:nth-child(1) { animation-delay: 0.2s; }
.menu-buttons .menu-btn:nth-child(2) { animation-delay: 0.35s; }
.menu-buttons .menu-btn:nth-child(3) { animation-delay: 0.5s; }
.menu-buttons .menu-btn:nth-child(4) { animation-delay: 0.65s; }

/* 3. Improved Premium Button Hover */
.menu-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important; /* Bouncy Effect */
}

.menu-btn:hover {
    letter-spacing: 5px !important; /* Expansion feel */
    background: #fff !important;
    color: var(--bg-dark) !important;
    transform: translateY(-5px) scale(1.02);
}

.menu-btn.primary:hover {
    background: var(--primary) !important;
    color: white !important;
    box-shadow: 0 12px 25px rgba(242, 83, 70, 0.4);
}

/* 4. Glassmorphism for Menu Container */
.menu-container {
    background: rgba(12, 20, 69, 0.7) !important; /* Darker Glass */
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6) !important;
}

/* 5. Smooth Overlay Transition */
.overlay-content {
    transform: scale(0.85);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.overlay:not(.hidden) .overlay-content {
    transform: scale(1);
}

/* 6. Professional Loading Bar */
.loader-bar {
    position: relative;
    border-radius: 20px;
}

.loader-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: #fff;
    filter: blur(5px);
    box-shadow: 0 0 15px #fff;
}

/* Game Over Screen Specifics */
.game-over-container {
    text-align: center;
    padding: 40px;
    background: linear-gradient(180deg, rgba(209, 183, 144, 0.1) 0%, rgba(12, 20, 69, 0.9) 100%);
    border: 2px solid var(--text-gold);
    border-radius: 30px;
    box-shadow: 0 0 50px rgba(209, 183, 144, 0.2);
    animation: levelUpPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Share Card Design */
.share-card {
    background: var(--white);
    color: var(--bg-dark);
    padding: 20px;
    border-radius: 20px;
    margin: 25px 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

.share-card::before {
    content: 'SKYWARD';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 4rem;
    font-weight: 900;
    opacity: 0.05;
    font-style: italic;
}

.final-score-value {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary);
    margin: 10px 0;
    display: block;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

/* Social Share Buttons */
.share-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.btn-share {
    padding: 12px 25px;
    border-radius: 50px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    background: #1da1f2; /* Twitter Blue as example */
    color: white;
}

.btn-share:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 10px 20px rgba(29, 161, 242, 0.4);
}

.btn-copy {
    background: var(--secondary);
}
