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

body {
    font-family: Arial, sans-serif;
    background-color: #111;
    color: #fff;
    overflow: hidden;
}

/* Common screen styles */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #111;
    z-index: 90;
}

.input-container {
    width: 100%;
    margin-top: 1.5rem;
}

/* Loading screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #111;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.loading-container {
    text-align: center;
    width: 80%;
    max-width: 400px;
}

.loading-container h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #4CAF50;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #333;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress {
    height: 100%;
    background-color: #4CAF50;
    width: 0%;
    transition: width 0.3s ease;
}

/* Login screen */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #111;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 90;
}

/* Logo styling */
.logo {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.login-container {
    text-align: center;
    width: 80%;
    max-width: 400px;
    padding: 2rem;
    background-color: #222;
    border-radius: 10px;
}

.login-container h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #4CAF50;
}

#username-input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    background-color: #333;
    color: #fff;
}

#start-game-btn {
    padding: 0.8rem 1.5rem;
    background-color: #4CAF50;
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

#start-game-btn:hover {
    background-color: #3e8e41;
}

/* Game container */
#game-canvas {
    display: block;
    width: 100vw;
    height: 100vh;
}

/* UI overlay */
#game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#score-panel {
    display: none !important;
}

/* Change the highlight effect for the score panel */
#score-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #FF5722, #FFEB3B);
    border-radius: 6px 6px 0 0;
}

/* Update value colors to contrast with blue */
#score-display span, 
#level-display span, 
#xp-display span {
    margin-left: 10px;
    font-weight: bold;
    color: #FFFFFF;
    text-shadow: none;
}

/* Label colors */
#score-display, 
#level-display, 
#xp-display {
    color: #FFFFFF;
    margin-bottom: 6px;
    white-space: nowrap;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-weight: bold;
}

/* Add a subtle hover effect */
#score-panel:hover {
    background-color: rgba(0, 0, 0, 0.9);
    transform: translateY(1px);
    transition: all 0.2s ease;
}

.ui-element {
    margin-bottom: 8px;
    z-index: 100;
}

#health-container {
    position: absolute;
    bottom: 40px;
    left: 20px;
    width: 200px;
    height: 18px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow: hidden;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

#health-bar {
    width: 100%;
    height: 100%;
    background-color: #4caf50;
    transition: width 0.3s, background-color 0.3s;
    min-width: 5px;
    position: relative;
}

#resource-display {
    position: absolute;
    bottom: 65px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    border-radius: 5px;
    color: white;
    z-index: 100;
    width: auto;
    max-width: 200px;
    display: inline-block;
}

/* Notifications */
#notification-area {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 400px;
    text-align: center;
    pointer-events: none;
}

.notification {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.8rem 1.5rem;
    margin-bottom: 0.5rem;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.3s;
}

.notification.visible {
    opacity: 1;
}

/* Mobile controls */
#mobile-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    pointer-events: auto;
}

#joystick-area {
    width: 150px;
    height: 150px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
}

#action-buttons {
    display: flex;
    flex-direction: column;
}

.action-button {
    width: 60px;
    height: 60px;
    margin-bottom: 0.5rem;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid #4CAF50;
    color: white;
    font-weight: bold;
}

/* Game over screen */
#game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.game-over-container {
    background-color: rgba(40, 40, 40, 0.9);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 500px;
    width: 80%;
}

#game-over-result {
    font-size: 2rem;
    margin-bottom: 20px;
}

#game-over-result.success {
    color: #4CAF50;
}

#game-over-result.failure {
    color: #f44336;
}

#game-over-stats {
    text-align: left;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

#return-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#return-btn:hover {
    background-color: #45a049;
}

#weapon-indicator {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 0.5rem;
    border-radius: 5px;
    position: fixed;
    bottom: 1rem;
    right: 1rem;
}

#minimap {
    width: 150px;
    height: 150px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    position: fixed;
    bottom: 1rem;
    left: 1rem;
}

/* Add these styles to your CSS file */
#next-mission-text {
    font-size: 1.2rem;
    margin: 20px 0;
    color: #aaa;
}

.loading-dots {
    display: inline-flex;
    margin: 0 auto;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    margin: 0 5px;
    background-color: #4CAF50;
    border-radius: 50%;
    animation: loading-dots 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loading-dots {
    0%, 80%, 100% { 
        transform: scale(0);
    }
    40% { 
        transform: scale(1.0);
    }
}

/* Add this to your existing CSS for the interaction prompt */
.interaction-prompt {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1.2em;
    text-align: center;
    pointer-events: none;
    z-index: 100;
    display: none;
}

/* Add these styles to your CSS file */
#portal-info {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 3px 8px;
    border-radius: 10px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Add this to your CSS for the username display */
.player-username {
    position: absolute;
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    padding: 2px 6px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 5;
    text-shadow: 0 0 2px black, 0 0 2px black;
    white-space: nowrap;
}

/* Update the resource counter CSS for better visibility */
.resource-counter {
    position: absolute;
    color: white;
    font-size: 14px;
    font-weight: bold;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    border-radius: 8px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
    text-shadow: 0 0 2px black;
    white-space: nowrap;
    border: 1px solid #4CAF50; /* Green border to match UI theme */
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* Fix for HP bar being cut off */
#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Add this style to prevent unnecessary black boxes */
#game-overlay > div {
    background-color: transparent;
}

/* Update the health-label CSS to make text smaller and reduce flickering */
.health-label {
    position: absolute;
    font-family: 'Arial', sans-serif;
    font-size: 12px;
    font-weight: bold;
    color: #000000;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 2px 5px;
    border-radius: 3px;
    text-align: center;
    transform: translate(-50%, 0);
    pointer-events: none;
    z-index: 100;
    text-shadow: 
        1px 1px 0 #fff,
        -1px 1px 0 #fff,
        1px -1px 0 #fff,
        -1px -1px 0 #fff;
}

/* XP Bar Styling */
.xp-bar-container {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 20px;
    z-index: 100;
}

.xp-bar-bg {
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    overflow: hidden;
}

.xp-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00a2ff, #00d2ff);
    border-radius: 10px;
    transition: width 0.3s ease-out;
}

.level-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Level Up Modal Styling */
#level-up-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#level-up-modal h2 {
    color: #00d2ff;
    font-size: 32px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.8);
}

.powerup-choices {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: 800px;
}

.powerup-choice {
    background-color: rgba(30, 30, 30, 0.9);
    border: 2px solid #00a2ff;
    border-radius: 8px;
    padding: 20px;
    width: 300px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.powerup-choice:hover {
    background-color: rgba(40, 40, 40, 0.9);
    transform: translateY(-5px);
    box-shadow: 0 0 15px rgba(0, 162, 255, 0.6);
}

.powerup-choice h3 {
    color: #00d2ff;
    font-size: 22px;
    margin-bottom: 10px;
}

.powerup-choice p {
    color: #ffffff;
    font-size: 16px;
}

/* Add this to your CSS file */
.health-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
    white-space: nowrap;
    pointer-events: none;
}

/* Styles for multiple level-up handling */
.level-up-subtitle {
    color: #ffffff;
    font-size: 18px;
    margin-bottom: 20px;
}

.level-up-set {
    width: 100%;
    max-width: 800px;
    margin-bottom: 20px;
}

.level-set-header {
    color: #00d2ff;
    font-size: 20px;
    margin-bottom: 10px;
    text-align: center;
} 