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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: white;
    overflow: hidden;
}

.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#gameCanvas {
    border: 2px solid #4a90e2;
    border-radius: 8px;
    background: #0f0f23;
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.3);
}

.ui-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 10;
    pointer-events: none;
}

.health-bars {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.boss-health {
    flex: 1;
}

.defenders-health {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.health-label {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.health-bar {
    width: 100%;
    height: 20px;
    background: rgba(0,0,0,0.7);
    border: 1px solid #333;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    transition: width 0.3s ease;
    position: absolute;
    left: 0;
}

.shield-fill {
    height: 100%;
    background: linear-gradient(90deg, #2196F3, #1976D2);
    transition: width 0.3s ease;
    position: absolute;
    right: 0;
}

.boss-health-fill {
    background: linear-gradient(90deg, #f44336, #d32f2f);
}

.health-text {
    font-size: 12px;
    margin-top: 2px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.game-status {
    position: absolute;
    top: 150px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    padding: 10px 20px;
    background: rgba(0,0,0,0.7);
    border-radius: 5px;
    border: 2px solid #4a90e2;
}

.controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: all;
}

button {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

button:hover {
    background: linear-gradient(135deg, #357abd, #2968a3);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

button:active {
    transform: translateY(0);
}

.defender-health.dead {
    opacity: 0.5;
}

.defender-health.dead .health-label {
    color: #ff4444;
}

.defender-health.downed {
    opacity: 0.7;
}

.defender-health.downed .health-label {
    color: #ff9800;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

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

.menu-container {
    text-align: center;
    max-width: 500px;
    padding: 40px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    border: 2px solid #4a90e2;
    box-shadow: 0 0 30px rgba(74, 144, 226, 0.3);
}

.game-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #4a90e2, #357abd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.menu-buttons {
    margin-bottom: 30px;
}

.menu-button {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
    margin: 10px;
    min-width: 200px;
    position: relative;
}

.menu-button:hover {
    background: linear-gradient(135deg, #357abd, #2968a3);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.5);
}

.game-description {
    color: #cccccc;
    font-size: 16px;
    line-height: 1.6;
}

.game-description p {
    margin-bottom: 10px;
}

.boss-selection {
    margin: 20px 0;
}

.boss-selection h3 {
    color: #cccccc;
    font-size: 16px;
    margin-bottom: 10px;
}

.boss-button {
    background: linear-gradient(135deg, #666666, #555555);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    margin: 5px;
    min-width: 120px;
}

.boss-button:hover {
    background: linear-gradient(135deg, #777777, #666666);
    transform: translateY(-2px);
}

.boss-button.selected {
    background: linear-gradient(135deg, #4a90e2, #357abd);
}

.boss-button.selected:hover {
    background: linear-gradient(135deg, #357abd, #2968a3);
}

.defender-selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.defender-selection-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.selection-container {
    text-align: center;
    max-width: 800px;
    padding: 40px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    border: 2px solid #4a90e2;
    box-shadow: 0 0 30px rgba(74, 144, 226, 0.3);
}

.selection-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #4a90e2, #357abd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.selection-subtitle {
    color: #cccccc;
    font-size: 18px;
    margin-bottom: 30px;
}

.available-defenders {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.defender-option {
    background: linear-gradient(135deg, #333333, #2a2a2a);
    color: white;
    border: 2px solid #555555;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.defender-option:hover {
    background: linear-gradient(135deg, #444444, #3a3a3a);
    border-color: #4a90e2;
    transform: translateY(-2px);
}

.defender-option.selected {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    border-color: #4a90e2;
}

.defender-option.selected:hover {
    background: linear-gradient(135deg, #357abd, #2968a3);
}

.defender-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.defender-desc {
    font-size: 12px;
    color: #cccccc;
}

.selected-team {
    margin: 30px 0;
}

.selected-team h3 {
    color: #cccccc;
    margin-bottom: 15px;
}

.selected-defenders {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    min-height: 50px;
    align-items: center;
}

.selected-defender {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    padding: 10px 15px;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    position: relative;
}

.remove-defender {
    background: none;
    border: none;
    color: #ff4444;
    font-weight: bold;
    margin-left: 10px;
    cursor: pointer;
    font-size: 16px;
}

.selection-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.victory-message-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.victory-message-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.message-container {
    text-align: center;
    max-width: 600px;
    padding: 40px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 15px;
    border: 2px solid #4CAF50;
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.3);
}

.victory-message {
    font-size: 24px;
    color: #4CAF50;
    font-weight: bold;
    margin-bottom: 30px;
    line-height: 1.4;
    font-style: italic;
}

.upgrade-selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.upgrade-selection-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.upgrade-container {
    text-align: center;
    max-width: 800px;
    padding: 40px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    border: 2px solid #4CAF50;
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.3);
}

.upgrade-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.upgrade-subtitle {
    color: #cccccc;
    font-size: 18px;
    margin-bottom: 30px;
}

.upgrade-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.upgrade-option {
    background: linear-gradient(135deg, #333333, #2a2a2a);
    color: white;
    border: 2px solid #555555;
    padding: 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    text-align: center;
    min-height: 100px;
    justify-content: center;
}

.upgrade-option:hover {
    background: linear-gradient(135deg, #444444, #3a3a3a);
    border-color: #4CAF50;
    transform: translateY(-2px);
}

.upgrade-option.selected {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-color: #4CAF50;
}

.upgrade-option.selected:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
}

.rocko-upgrade-selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.rocko-upgrade-selection-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.rocko-upgrade-option {
    background: linear-gradient(135deg, #333333, #2a2a2a);
    color: white;
    border: 2px solid #555555;
    padding: 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    text-align: center;
    min-height: 100px;
    justify-content: center;
}

.rocko-upgrade-option:hover {
    background: linear-gradient(135deg, #444444, #3a3a3a);
    border-color: #ff6600;
    transform: translateY(-2px);
}

.rocko-upgrade-option.selected {
    background: linear-gradient(135deg, #ff6600, #e55a00);
    border-color: #ff6600;
}

.rocko-upgrade-option.selected:hover {
    background: linear-gradient(135deg, #e55a00, #cc5200);
}

.upgrade-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.level-selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.level-selection-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.level-container {
    text-align: center;
    max-width: 800px;
    padding: 40px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    border: 2px solid #4a90e2;
    box-shadow: 0 0 30px rgba(74, 144, 226, 0.3);
}

.level-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #4a90e2, #357abd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.level-subtitle {
    color: #cccccc;
    font-size: 18px;
    margin-bottom: 30px;
}

.level-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.level-option {
    background: linear-gradient(135deg, #333333, #2a2a2a);
    color: white;
    border: 2px solid #555555;
    padding: 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    text-align: center;
    min-height: 80px;
    justify-content: center;
}

.level-option:hover:not(.locked) {
    background: linear-gradient(135deg, #444444, #3a3a3a);
    border-color: #4a90e2;
    transform: translateY(-2px);
}

.level-option.locked {
    background: linear-gradient(135deg, #222222, #1a1a1a);
    border-color: #333333;
    cursor: not-allowed;
    opacity: 0.5;
}

.level-option.locked .level-name,
.level-option.locked .level-desc {
    color: #666666;
}

.level-name {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 5px;
}

.level-desc {
    font-size: 14px;
    color: #cccccc;
}

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