/* Local Fonts */
/* latin-ext */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Reset & Variables */
:root {
    --bg-gradient: linear-gradient(135deg, #1e1b4b 0%, #311042 50%, #4c0519 100%);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-blur: blur(12px);
    
    --primary-color: #f59e0b; /* Warm gold/orange */
    --primary-hover: #d97706;
    --secondary-color: rgba(255, 255, 255, 0.15);
    --secondary-hover: rgba(255, 255, 255, 0.25);
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-family);
    color: var(--text-main);
    background: #000;
}

/* App Container */
#game-app {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--bg-gradient);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Decor */
.sky-decor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 20%, rgba(245, 158, 11, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.stars-decor {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 20px 30px, #eee, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 150px 50px, #fff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 80px 220px, #ddd, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 250px 120px, #fff, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 350px 280px, #eee, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 550px 550px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
}

/* Screen Management */
.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* Buttons */
.btn {
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 1rem;
    padding: 12px 28px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    transform: translateY(-3px);
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-danger:hover {
    background: var(--danger-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-circle {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.2rem;
    background: var(--secondary-color);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-circle:hover {
    background: var(--secondary-hover);
    transform: scale(1.1);
}

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

/* 1. Welcome Screen Styling */
.menu-content {
    text-align: center;
    z-index: 12;
}

.game-logo {
    font-size: 5rem;
    font-weight: 800;
    background: linear-gradient(to bottom, #fff 30%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    letter-spacing: -2px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
    animation: titleFloat 4s ease-in-out infinite;
}

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

.game-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    max-width: 280px;
    margin: 0 auto;
}

.menu-buttons .btn {
    width: 100%;
}

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

/* 2. Level Screen Styling */
.back-nav {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 20;
}

.level-content {
    width: 100%;
    max-width: 900px;
    text-align: center;
    z-index: 12;
    max-height: 80vh;
    overflow-y: auto;
    padding: 10px;
}

.level-content::-webkit-scrollbar {
    width: 6px;
}
.level-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}
.level-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
.level-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.level-content h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    padding: 10px;
}

/* Level Card */
.level-card {
    aspect-ratio: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.level-card:hover:not(.locked) {
    transform: translateY(-5px) scale(1.05);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.level-card .level-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
}

.level-card .level-stars {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #e2e8f0;
    letter-spacing: 2px;
}

.level-card .level-stars .star-gold {
    color: var(--primary-color);
}

.level-card .level-score {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Locked level card */
.level-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.level-card.locked .level-num {
    display: none;
}

.level-card.locked::after {
    content: "🔒";
    font-size: 2rem;
}

/* 3. In-Game HUD */
#play-screen {
    padding: 0;
    justify-content: flex-start;
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
}

.hud-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hud-center {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-main);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.hud-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.score-display {
    display: flex;
    flex-direction: column;
}

.score-display .label {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    font-weight: 600;
}

.score-display .value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-color);
}

/* Game Canvas Container */
#canvas-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 5;
    background: #0d1117;
}

#game-canvas {
    background: transparent;
    display: block;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

/* Ability Activator prompt */
#ability-prompt {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(245, 158, 11, 0.85);
    color: #000;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 30px;
    z-index: 25;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    animation: pulsePrompt 1.5s infinite ease-in-out;
}

@keyframes pulsePrompt {
    0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(0.95); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

.hidden {
    display: none !important;
}

/* Queue List HUD */
#bird-queue-hud {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 20;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    padding: 10px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#bird-queue-hud .label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

#bird-queue-list {
    display: flex;
    gap: 8px;
    align-items: center;
}

.queue-bird-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.queue-bird-dot.red { background: #ef4444; }
.queue-bird-dot.yellow { background: #facc15; }
.queue-bird-dot.blue { background: #3b82f6; }
.queue-bird-dot.black { background: #1e293b; border-color: #ef4444; }

/* Modals Overlay Base */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

#settings-modal {
    z-index: 110;
}

/* Modal Content Card */
.modal-content.glass {
    background: rgba(20, 20, 35, 0.85);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow);
    border-radius: 32px;
    width: 90%;
    max-width: 420px;
    padding: 40px 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-content h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.modal-content p {
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 24px;
}

.modal-buttons .btn {
    width: 100%;
}

/* Stars Rating */
.star-rating {
    position: relative;
    font-size: 3.5rem;
    height: 70px;
    line-height: 70px;
    color: rgba(255, 255, 255, 0.1);
    letter-spacing: 10px;
    margin-bottom: 20px;
}

.star-rating .star-placeholder {
    display: inline-block;
}

.star-golds {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    color: var(--primary-color);
    pointer-events: none;
}

.star.gold {
    display: inline-block;
    animation: starPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.5) forwards;
}

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

/* Stats Box inside modals */
.stats-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px 24px;
    width: 100%;
    margin-bottom: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    margin: 8px 0;
}

.stat-row strong {
    color: var(--primary-color);
}

.celebration-emoji {
    font-size: 4rem;
    margin-bottom: 12px;
    animation: emojiBounce 1s ease infinite alternate;
}

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

.title-success {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.title-failed {
    background: linear-gradient(135deg, #fca5a5 0%, #ef4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Settings elements */
.settings-group {
    width: 100%;
    margin: 20px 0;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label {
    font-size: 1.1rem;
    font-weight: 600;
}

.setting-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 52px;
    height: 28px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
    border: 1px solid rgba(255,255,255,0.1);
}

.setting-item input[type="checkbox"]::before {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    top: 2px;
    left: 2px;
    transition: left 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.setting-item input[type="checkbox"]:checked {
    background: var(--primary-color);
}

.setting-item input[type="checkbox"]:checked::before {
    left: 26px;
}

.settings-warning {
    margin-top: 10px;
    width: 100%;
}

.settings-warning .btn {
    width: 100%;
    font-size: 0.9rem;
    padding: 10px 20px;
}

/* Scale up animation for modals */
.scale-up {
    animation: scaleUpAnim 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

/* In-game Style Animated Background */
.sky-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #111827 0%, #1e293b 60%, #3b0764 90%);
    overflow: hidden;
    z-index: 2; /* Sits behind screen content (z-index: 10) */
}

/* Twilight Sun Horizon Glow */
.sun-glow {
    position: absolute;
    width: 560px;
    height: 560px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.18) 0%, rgba(236, 72, 153, 0.04) 50%, rgba(0, 0, 0, 0) 100%);
    bottom: -100px;
    left: 10%;
    border-radius: 50%;
    pointer-events: none;
}

/* Twinkling Stars */
.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1.5px 1.5px at 20px 30px, #eee, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 150px 50px, #fff, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 80px 220px, #ddd, rgba(0,0,0,0)),
        radial-gradient(2.5px 2.5px at 250px 120px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 350px 280px, #eee, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 450px 100px, #ddd, rgba(0,0,0,0)),
        radial-gradient(2.5px 2.5px at 600px 180px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 750px 240px, #eee, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 600px 600px;
    opacity: 0.3;
    pointer-events: none;
    animation: starsTwinkle 8s infinite ease-in-out;
}

@keyframes starsTwinkle {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 0.6; }
}

/* Drifting Clouds */
.clouds-container {
    position: absolute;
    width: 100%;
    height: 60%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
}

.cloud {
    position: absolute;
    width: 120px;
    height: 60px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 50"><path d="M 20 35 A 15 15 0 0 1 35 20 A 20 20 0 0 1 70 20 A 15 15 0 0 1 80 35 Z" fill="rgba(255,255,255,0.06)"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
}

.cloud-1 {
    top: 10%;
    left: -120px;
    transform: scale(1.5);
    animation: cloudDrift 55s infinite linear;
}

.cloud-2 {
    top: 25%;
    left: -120px;
    transform: scale(0.9);
    animation: cloudDrift 85s infinite linear;
    animation-delay: -20s;
}

.cloud-3 {
    top: 40%;
    left: -120px;
    transform: scale(1.2);
    animation: cloudDrift 115s infinite linear;
    animation-delay: -45s;
}

@keyframes cloudDrift {
    0% { left: -150px; }
    100% { left: 100%; }
}

/* Parallax Landscape Layers */
.mountain-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    bottom: 0;
    left: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 600" preserveAspectRatio="none"><path d="M 0 550 Q 150 280 300 420 Q 450 240 600 480 Q 750 310 900 450 Q 1100 260 1300 550 L 1300 600 L 0 600 Z" fill="%23261233"/></svg>');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: bottom center;
    pointer-events: none;
    transform-origin: bottom center;
    transition: transform 0.1s ease-out; /* Smooth hover transition */
}

.hill-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    bottom: 0;
    left: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 600" preserveAspectRatio="none"><path d="M 0 550 Q 200 400 400 490 Q 600 360 800 510 Q 1000 380 1200 550 L 1200 600 L 0 600 Z" fill="%23102230"/></svg>');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: bottom center;
    pointer-events: none;
    transform-origin: bottom center;
    transition: transform 0.08s ease-out;
}

.ground-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    bottom: 0;
    left: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 600" preserveAspectRatio="none"><rect x="0" y="540" width="1000" height="60" fill="%23151e18"/><rect x="0" y="540" width="1000" height="10" fill="%231e3a2f"/><rect x="0" y="540" width="1000" height="3" fill="%234ade80"/></svg>');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: bottom center;
    pointer-events: none;
}

/* Portrait Orientation Prompt Overlay */
.portrait-prompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0f0c1b;
    z-index: 9999;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    padding: 20px;
}
.prompt-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: rotateDevice 2s infinite ease-in-out;
}
.prompt-text {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: 1px;
}
.prompt-subtext {
    font-size: 1rem;
    color: var(--text-muted);
}
@keyframes rotateDevice {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-90deg); }
}

/* Responsive Scaling for Mobile Screens (Landscape Height <= 520px or Width <= 950px) */
@media screen and (max-width: 950px) and (orientation: portrait) {
    .portrait-prompt {
        display: flex;
    }
}

@media screen and (max-height: 520px) {
    .game-logo {
        font-size: clamp(2rem, 10vw, 3.5rem);
        margin-bottom: 6px;
    }
    .game-subtitle {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    .menu-buttons {
        gap: 10px;
        max-width: 220px;
    }
    .btn {
        padding: 8px 20px;
        font-size: 0.9rem;
    }
    .footer-info {
        bottom: 10px;
        font-size: 0.7rem;
    }
    .back-nav {
        top: 15px;
        left: 15px;
    }
    .level-content h2 {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
    .level-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 12px;
    }
    .level-card {
        border-radius: 16px;
    }
    .level-card .level-num {
        font-size: 1.4rem;
    }
    .level-card .level-stars {
        font-size: 0.75rem;
        margin-top: 4px;
    }
    .level-card .level-score {
        font-size: 0.65rem;
    }
    #hud {
        height: 50px;
        padding: 0 20px;
    }
    .hud-center {
        font-size: 1.1rem;
    }
    .score-display .value {
        font-size: 0.95rem;
    }
    #bird-queue-hud {
        bottom: 10px;
        left: 10px;
        padding: 6px 12px;
        border-radius: 12px;
        gap: 8px;
    }
    #bird-queue-hud .label {
        font-size: 0.65rem;
    }
    .queue-bird-dot {
        width: 14px;
        height: 14px;
    }
    #ability-prompt {
        bottom: 60px;
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    .modal-content.glass {
        padding: 20px 25px;
        border-radius: 24px;
        max-width: 380px;
    }
    .modal-content h2 {
        font-size: 1.6rem;
        margin-bottom: 12px;
    }
    .star-rating {
        font-size: 2.4rem;
        height: 48px;
        line-height: 48px;
        margin-bottom: 12px;
    }
    .celebration-emoji {
        font-size: 2.5rem;
        margin-bottom: 8px;
    }
    .stats-box {
        padding: 10px 16px;
        margin-bottom: 8px;
        border-radius: 12px;
    }
    .stat-row {
        font-size: 0.9rem;
        margin: 4px 0;
    }
    .modal-buttons {
        flex-direction: row; /* Horizontal layout for save space */
        gap: 8px;
        margin-top: 12px;
    }
    .modal-buttons .btn {
        padding: 8px 16px;
    }
    .settings-group {
        margin: 10px 0;
    }
    .setting-item {
        padding: 8px 0;
    }
    .setting-item label {
        font-size: 0.95rem;
    }
}
