:root {
    --primary-color: #4A90E2;
    --secondary-color: #E74C3C;
    --accent-color: #00BFFF;
    --bg-dark: #000011;
    --bg-space: #001122;
    --text-light: #ffffff;
    --text-dim: #cccccc;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-glow: rgba(74, 144, 226, 0.3);
    --gradient-space: linear-gradient(135deg, #000011 0%, #001122 50%, #000033 100%);
}

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

body {
    font-family: 'Arial', sans-serif;
    background: var(--gradient-space);
    color: var(--text-light);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    padding-top: 60px;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.8) 1px, transparent 1px),
        radial-gradient(circle at 80% 40%, rgba(255, 255, 255, 0.6) 1px, transparent 1px),
        radial-gradient(circle at 40% 70%, rgba(255, 255, 255, 0.7) 1px, transparent 1px),
        radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.5) 1px, transparent 1px),
        radial-gradient(circle at 10% 90%, rgba(255, 255, 255, 0.6) 1px, transparent 1px),
        radial-gradient(circle at 70% 10%, rgba(255, 255, 255, 0.8) 1px, transparent 1px),
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4) 1px, transparent 1px),
        radial-gradient(circle at 60% 85%, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
    background-size: 200px 200px, 300px 300px, 250px 250px, 180px 180px, 220px 220px, 280px 280px, 150px 150px, 320px 320px;
    animation: starfield 60s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes starfield {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-200px, -200px); }
}

/* Header Styles */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    text-shadow: 0 0 10px var(--shadow-glow);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    background: var(--glass-bg);
}

.nav-links a:hover {
    background: var(--glass-border);
    box-shadow: 0 0 20px var(--shadow-glow);
}

/* Canvas Styles */
#gameCanvas {
    position: absolute;
    top: 160px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    border: 2px solid var(--glass-border);
    border-radius: 10px;
    box-shadow: 0 0 50px var(--shadow-glow);
    z-index: 10;
}

/* HUD Styles */
.hud {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    padding: 15px 30px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 0 20px var(--shadow-glow);
}

.hud.hidden {
    display: none;
}

.score-display {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-light);
    text-shadow: 0 0 10px var(--accent-color);
}

.accumulated-score-display {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-color);
    background: var(--glass-bg);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    text-shadow: 0 0 8px var(--primary-color);
}

.level-display {
    font-size: 16px;
    color: var(--text-dim);
    background: var(--glass-bg);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.hud-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pause-icon {
    width: 16px;
    height: 16px;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.pause-icon-large {
    width: 32px;
    height: 32px;
    color: var(--text-light);
    margin-right: 10px;
    vertical-align: middle;
    display: inline-block;
}

/* Mission Paused title spacing */
#pauseScreen h2 {
    margin-bottom: 20px;
}

.hud-btn:hover {
    background: var(--glass-border);
    box-shadow: 0 0 15px var(--shadow-glow);
}

.hud-btn:hover .pause-icon {
    color: var(--accent-color);
}

/* Screen Overlays */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 17, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
}

.screen-content {
    text-align: center;
    max-width: 600px;
    padding: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 0 50px var(--shadow-glow);
}

.game-title {
    font-size: 48px;
    margin-bottom: 10px;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px var(--shadow-glow);
}

.game-subtitle {
    font-size: 18px;
    color: var(--text-dim);
    margin-bottom: 30px;
}

.difficulty-section {
    margin: 30px 0;
}

.difficulty-section h3 {
    margin-bottom: 20px;
    color: var(--text-light);
    font-size: 20px;
}

.difficulty-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.difficulty-btn {
    padding: 20px;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 15px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    backdrop-filter: blur(10px);
}

.difficulty-btn:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px var(--shadow-glow);
    transform: translateY(-2px);
}

.difficulty-btn.selected {
    border-color: var(--accent-color);
    background: rgba(74, 144, 226, 0.2);
    box-shadow: 0 0 25px var(--shadow-glow);
}

.difficulty-btn .rank {
    display: block;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.difficulty-btn .desc {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
}

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

.primary-btn, .secondary-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    backdrop-filter: blur(10px);
}

.primary-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    color: var(--text-light);
    box-shadow: 0 0 20px var(--shadow-glow);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 30px var(--shadow-glow);
}

.secondary-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
}

.secondary-btn:hover {
    background: var(--glass-border);
    box-shadow: 0 0 15px var(--shadow-glow);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 17, 0.9);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    padding: 40px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 50px var(--shadow-glow);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    background: var(--glass-border);
    box-shadow: 0 0 10px var(--shadow-glow);
}

.modal h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-light);
    font-size: 24px;
}

.instructions-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.instruction-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: var(--glass-bg);
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}

.instruction-item .icon {
    font-size: 24px;
    flex-shrink: 0;
}

.instruction-item div {
    color: var(--text-light);
    line-height: 1.5;
}

.instruction-item strong {
    color: var(--accent-color);
}

/* Leaderboard Styles */
.leaderboard-list {
    margin: 20px 0;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--glass-bg);
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    margin-bottom: 10px;
}

.leaderboard-rank {
    font-weight: bold;
    color: var(--accent-color);
    width: 40px;
}

.leaderboard-name {
    flex: 1;
    text-align: left;
    margin-left: 15px;
}

.leaderboard-score {
    font-weight: bold;
    color: var(--primary-color);
}

.leaderboard-empty {
    text-align: center;
    color: var(--text-dim);
    padding: 40px;
    font-style: italic;
}

/* Game Over Styles */
.final-score {
    font-size: 24px;
    margin: 20px 0;
    color: var(--text-light);
}

.game-over-message {
    font-size: 18px;
    color: var(--text-dim);
    margin: 20px 0;
    padding: 20px;
    background: var(--glass-bg);
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}

/* High Score Celebration */
.modal.celebration .modal-content {
    text-align: center;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.2), rgba(0, 191, 255, 0.2));
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 100px var(--shadow-glow);
}

.celebration-title {
    font-size: 32px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px #FFD700; }
    to { text-shadow: 0 0 40px #FFA500; }
}

.celebration-message {
    margin: 20px 0;
    font-size: 18px;
}

.name-input-section {
    margin: 30px 0;
}

.name-input-section label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-light);
}

.name-input-section input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--glass-border);
    border-radius: 10px;
    background: var(--glass-bg);
    color: var(--text-light);
    font-size: 16px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.name-input-section input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 20px var(--shadow-glow);
}

/* Confetti Animation */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--accent-color);
    animation: confetti-fall 3s linear infinite;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Loading Screen */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--glass-border);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .game-title {
        font-size: 36px;
    }
    
    .screen-content {
        padding: 20px;
        margin: 20px;
        max-width: 90vw;
    }
    
    .difficulty-section {
        margin: 20px 0;
    }
    
    .difficulty-section h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .difficulty-buttons {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .difficulty-btn {
        min-width: 220px;
        padding: 15px 20px;
    }
    
    .difficulty-btn .rank {
        font-size: 16px;
    }
    
    .difficulty-btn .desc {
        font-size: 11px;
    }
    
    .menu-buttons {
        gap: 12px;
        margin-top: 25px;
    }
    
    #gameCanvas {
        width: 95vw;
        height: auto;
        max-width: 400px;
        top: 180px;
    }
    
    .hud {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 8px 16px;
        top: 100px;
        min-width: 200px;
        border-radius: 15px;
    }
    
    .score-display {
        font-size: 20px;
    }
    
    .accumulated-score-display {
        font-size: 14px;
        padding: 4px 12px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .instruction-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 10px;
    }
    
    .instructions-content {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 28px;
        margin-bottom: 8px;
    }
    
    .game-subtitle {
        font-size: 16px;
        margin-bottom: 20px;
    }
    
    .screen-content {
        padding: 15px;
        margin: 15px;
        max-width: 95vw;
    }
    
    .difficulty-section {
        margin: 15px 0;
    }
    
    .difficulty-section h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .primary-btn, .secondary-btn {
        min-width: 180px;
        padding: 12px 24px;
        font-size: 14px;
    }
    
    .difficulty-btn {
        min-width: 200px;
        padding: 12px 15px;
    }
    
    .difficulty-btn .rank {
        font-size: 15px;
    }
    
    .difficulty-btn .desc {
        font-size: 10px;
    }
    
    #gameCanvas {
        top: 160px;
    }
    
    
    .hud {
        top: 85px;
        padding: 6px 12px;
        min-width: 180px;
        border-radius: 12px;
        gap: 8px;
    }
    
    .score-display {
        font-size: 16px;
    }
    
    .accumulated-score-display {
        font-size: 12px;
        padding: 3px 10px;
    }
    
    .level-display {
        font-size: 12px;
        padding: 3px 8px;
        white-space: nowrap;
    }
    
    .hud-btn {
        padding: 4px 6px;
        font-size: 12px;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Extra small screens */
@media (max-width: 320px) {
    .hud {
        min-width: 160px;
        padding: 5px 10px;
        gap: 6px;
        border-radius: 10px;
    }
    
    .score-display {
        font-size: 14px;
    }
    
    .accumulated-score-display {
        font-size: 10px;
        padding: 2px 8px;
    }
    
    .level-display {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .hud-btn {
        width: 24px;
        height: 24px;
        font-size: 10px;
        padding: 0;
    }
}

/* Extra small landscape screens */
@media (max-width: 568px) and (orientation: landscape) and (max-height: 320px) {
    .screen-content {
        max-height: calc(100vh - 40px);
        padding: 5px;
        margin: 5px;
        max-width: calc(100vw - 20px);
    }
    
    .game-title {
        font-size: 16px;
        margin-bottom: 2px;
    }
    
    .game-subtitle {
        font-size: 10px;
        margin-bottom: 5px;
    }
    
    .difficulty-section {
        margin: 5px 0;
    }
    
    .difficulty-section h3 {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .difficulty-btn {
        min-width: 60px;
        padding: 4px 6px;
    }
    
    .difficulty-btn .rank {
        font-size: 10px;
    }
    
    .difficulty-btn .desc {
        font-size: 7px;
    }
    
    .primary-btn, .secondary-btn {
        min-width: 100px;
        padding: 6px 12px;
        font-size: 10px;
    }
    
    .menu-buttons {
        gap: 4px;
        margin-top: 5px;
    }
}

/* Pause icon responsive sizing */
@media (max-width: 768px) {
    .pause-icon {
        width: 14px;
        height: 14px;
    }
    
    .pause-icon-large {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .pause-icon {
        width: 12px;
        height: 12px;
    }
    
    .pause-icon-large {
        width: 24px;
        height: 24px;
        margin-right: 8px;
    }
    
    #pauseScreen h2 {
        margin-bottom: 15px;
    }
}

@media (max-width: 320px) {
    .pause-icon {
        width: 10px;
        height: 10px;
    }
    
    .pause-icon-large {
        width: 20px;
        height: 20px;
        margin-right: 6px;
    }
}

@media (orientation: landscape) and (max-height: 600px) and (max-width: 1024px) {
    .pause-icon {
        width: 10px !important;
        height: 10px !important;
    }
    
    .pause-icon-large {
        width: 18px !important;
        height: 18px !important;
        margin-right: 6px !important;
    }
    
    #pauseScreen h2 {
        margin-bottom: 10px !important;
    }
}

/* Touch-friendly improvements */
@media (pointer: coarse) {
    .primary-btn, .secondary-btn, .difficulty-btn, .hud-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .close-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .nav-links a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .difficulty-btn {
        min-height: 60px;
    }
    
    /* Better spacing for touch targets */
    .menu-buttons {
        gap: 16px;
    }
    
    .difficulty-buttons {
        gap: 12px;
    }
}

/* AGGRESSIVE Mobile landscape mode - FULL SCREEN */
@media (orientation: landscape) and (max-height: 600px) and (max-width: 1024px) {
    html, body {
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        height: 100vh !important;
        width: 100vw !important;
    }
    
    .main-header {
        display: none !important; /* Completely hide header in landscape */
    }
    
    #gameCanvas {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: none !important;
        max-height: none !important;
        transform: none !important;
        border: none !important;
        border-radius: 0 !important;
        z-index: 10 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .hud {
        position: fixed !important;
        top: 10px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        padding: 4px 12px !important;
        min-width: 120px !important;
        border-radius: 12px !important;
        gap: 8px !important;
        z-index: 1000 !important;
        background: rgba(0, 0, 17, 0.8) !important;
        backdrop-filter: blur(15px) !important;
    }
    
    .score-display {
        font-size: 16px !important;
    }
    
    .accumulated-score-display {
        font-size: 11px !important;
        padding: 2px 6px !important;
    }
    
    .level-display {
        font-size: 12px !important;
        padding: 3px 8px !important;
    }
    
    .hud-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 12px !important;
        padding: 0 !important;
    }
    
    .score-display {
        font-size: 14px;
    }
    
    .level-display {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .hud-btn {
        width: 24px;
        height: 24px;
        font-size: 10px;
        padding: 0;
    }
    
    /* Menu screens in landscape */
    .screen-content {
        max-height: 90vh;
        padding: 15px;
        overflow-y: auto;
    }
    
    .game-title {
        font-size: 24px;
        margin-bottom: 5px;
    }
    
    .game-subtitle {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .difficulty-section {
        margin: 15px 0;
    }
    
    .difficulty-section h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .difficulty-buttons {
        flex-direction: row;
        gap: 8px;
        flex-wrap: nowrap;
    }
    
    .difficulty-btn {
        min-width: 100px;
        padding: 8px 10px;
        flex: 1;
    }
    
    .difficulty-btn .rank {
        font-size: 14px;
    }
    
    .difficulty-btn .desc {
        font-size: 9px;
    }
    
    .menu-buttons {
        gap: 8px;
    }
    
    .primary-btn, .secondary-btn {
        min-width: 140px;
        padding: 10px 20px;
        font-size: 13px;
    }
    
    /* Ensure no white space around canvas in landscape */
    body::before {
        display: none; /* Hide animated starfield to improve performance */
    }
    
    body {
        margin: 0;
        padding-left: 0;
        padding-right: 0;
    }
    
    .container {
        padding: 0 10px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --glass-bg: rgba(255, 255, 255, 0.2);
        --glass-border: rgba(255, 255, 255, 0.5);
    }
}

/* Virtual Joystick Styles */
.virtual-joystick {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 1000;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.virtual-joystick.active {
    opacity: 1;
}

.virtual-joystick.hidden {
    display: none;
}

.joystick-base {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    box-shadow: 0 0 20px var(--shadow-glow);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.joystick-handle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    box-shadow: 0 0 15px var(--shadow-glow);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.1s ease;
    border: 1px solid var(--glass-border);
}

/* Mobile-specific joystick adjustments */
@media (max-width: 768px) {
    .virtual-joystick {
        bottom: 30px;
        right: 30px;
    }
    
    .joystick-base {
        width: 90px;
        height: 90px;
    }
    
    .joystick-handle {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .virtual-joystick {
        bottom: 25px;
        right: 25px;
    }
    
    .joystick-base {
        width: 80px;
        height: 80px;
    }
    
    .joystick-handle {
        width: 28px;
        height: 28px;
    }
}

/* Landscape joystick positioning */
@media (orientation: landscape) and (max-height: 600px) and (max-width: 1024px) {
    .virtual-joystick {
        bottom: 20px;
        right: 20px;
        z-index: 2000;
    }
    
    .joystick-base {
        width: 70px;
        height: 70px;
    }
    
    .joystick-handle {
        width: 24px;
        height: 24px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    body::before {
        animation: none;
    }
}

/* Level Up Message */
.level-up-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px 40px;
    text-align: center;
    box-shadow: 0 0 30px var(--shadow-glow);
    animation: levelUpAnimation 3s ease-in-out;
}

.level-up-message h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color), #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.level-up-message p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin: 0;
}

@keyframes levelUpAnimation {
    0% {
        opacity: 0;
        scale: 0.5;
    }
    10% {
        opacity: 1;
        scale: 1.1;
    }
    20% {
        scale: 1;
    }
    80% {
        opacity: 1;
        scale: 1;
    }
    100% {
        opacity: 0;
        scale: 0.8;
    }
}

/* Mobile responsive level up message */
@media (max-width: 768px) {
    .level-up-message {
        padding: 20px 30px;
        max-width: 90vw;
    }
    
    .level-up-message h2 {
        font-size: 2rem;
    }
    
    .level-up-message p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .level-up-message {
        padding: 15px 20px;
    }
    
    .level-up-message h2 {
        font-size: 1.5rem;
    }
    
    .level-up-message p {
        font-size: 0.9rem;
    }
}