body {
            margin: 0;
            padding: 0;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #0f0f23, #1a1a3a);
            color: #ffffff;
            overflow: hidden;
            cursor: crosshair;
        }
        
        #gameContainer {
            position: relative;
            width: 100vw;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        
        #gameCanvas {
            background: radial-gradient(circle at center, #1a1a2e, #16213e);
            border-radius: 8px;
            box-shadow: 0 0 50px rgba(0, 150, 255, 0.3);
        }
        
        #ui {
            position: absolute;
            top: 20px;
            left: 20px;
            z-index: 1000;
            background: rgba(0, 0, 0, 0.8);
            padding: 15px;
            border-radius: 10px;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        #loadingScreen {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.9);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 2000;
            transition: opacity 0.5s ease;
        }
        
        #loadingScreen.hidden {
            opacity: 0;
            pointer-events: none;
        }
        
        .loading-spinner {
            width: 50px;
            height: 50px;
            border: 3px solid rgba(0, 150, 255, 0.3);
            border-top: 3px solid #0096ff;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 20px;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        .progress-bar {
            width: 300px;
            height: 6px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 3px;
            overflow: hidden;
            margin: 10px 0;
        }
        
        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #0096ff, #00d4ff);
            width: 0%;
            transition: width 0.3s ease;
        }
        
        .status-text {
            font-size: 14px;
            color: #888;
            margin-top: 10px;
        }
        
        .win-condition {
            margin-bottom: 10px;
            padding: 8px;
            background: rgba(255, 215, 0, 0.15);
            border: 1px solid rgba(255, 215, 0, 0.4);
            border-radius: 5px;
            font-size: 12px;
            color: #FFD700;
            text-align: center;
        }
        
        .win-text {
            color: #FFF;
            font-weight: bold;
            text-shadow: 0 0 5px #FFD700;
        }
        
        .controls {
            font-size: 12px;
            line-height: 1.4;
            color: #aaa;
        }
        
        .hook-status {
            margin-top: 10px;
            padding: 8px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 5px;
            font-size: 11px;
        }
        
        .hook-status.ready { background: rgba(0, 255, 0, 0.2); }
        .hook-status.flying { background: rgba(255, 255, 0, 0.2); }
        .hook-status.returning { background: rgba(255, 165, 0, 0.2); }
        .hook-status.cooldown { background: rgba(255, 0, 0, 0.2); }

        .melee-status {
            margin-top: 5px;
            padding: 5px;
            background: rgba(0, 0, 0, 0.7);
            border-radius: 3px;
            font-size: 12px;
        }
        
        .melee-status.ready { 
            background: rgba(0, 255, 0, 0.3);
            color: #90EE90;
        }
        
        .melee-status.cooldown { 
            background: rgba(255, 0, 0, 0.3);
            color: #FFB6C1;
        }

        .cooldown-container {
            margin-top: 10px;
            padding: 5px;
            background: rgba(0, 0, 0, 0.5);
            border-radius: 5px;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .respawn-status {
            margin-top: 5px;
            padding: 5px;
            background: rgba(0, 0, 0, 0.7);
            border-radius: 3px;
            font-size: 12px;
        }
        
        .respawn-status.ready { 
            background: rgba(0, 255, 0, 0.3);
            color: #90EE90;
        }
        
        .respawn-status.cooldown { 
            background: rgba(255, 255, 0, 0.3);
            color: #FFFF00;
            font-weight: bold;
        }

/* Scoreboard Styles */
#scoreboard {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: bold;
    user-select: none;
}

.scoreboard-win-condition {
    color: #FFD700;
    font-size: 12px;
    font-weight: normal;
    text-shadow: 0 0 5px #FFD700;
    margin-bottom: 5px;
}

.scoreboard-scores {
    display: flex;
    align-items: center;
    gap: 20px;
}

#team1Score {
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
}

.scoreboard-separator {
    color: #ffffff;
    font-size: 16px;
}

#team2Score {
    color: #ff4444;
    text-shadow: 0 0 5px #ff4444;
}

/* Stats Display Styles */
#statsDisplay {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: white;
    user-select: none;
    min-width: 200px;
}

.stats-title {
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 5px;
}

/* Monster UI Styles */
.monster-ui {
    position: absolute;
    pointer-events: none;
    z-index: 1000;
    transform-origin: center bottom;
    font-family: Arial, sans-serif;
    font-size: 25px;
    user-select: none;
    display: none;
    transition: opacity 0.3s ease;
}

.monster-name {
    text-align: center;
    color: white;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    font-weight: bold;
    margin-bottom: 2px;
    font-size: 25px;
}

.monster-name.human {
    color: #00ff00;
}

.monster-name.team1 {
    color: #00ff00;
}

.monster-name.team2 {
    color: #ff4444;
}

.monster-name.dead {
    color: #666666;
}

.monster-name.hooked {
    color: #ffff00;
}

.gold-display {
    text-align: center;
    color: #FFD700;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    font-weight: bold;
    margin-bottom: 2px;
    font-size: 20px;
}

.hp-bar-container {
    width: 60px;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
}

.hp-bar-container.damage-flash {
    box-shadow: 0 0 10px #ff0000;
}

.hp-bar-fill {
    width: 100%;
    height: 100%;
    background: #00ff00;
    transition: width 0.2s ease-out;
}

.hp-bar-fill.low {
    background: #ffff00;
}

.hp-bar-fill.critical {
    background: #ff0000;
}

.hp-text {
    text-align: center;
    color: white;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    font-size: 12px;
    margin-top: 2px;
}

.monster-name.damage-flash {
    color: #ff0000;
}

/* Monster UI Animation Effects */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.hooked-effect {
    filter: drop-shadow(0 0 5px #ffff00);
    animation: shake 0.3s infinite;
}

/* Game UI Header Styles */
.game-header {
    margin: 0 0 10px 0;
    color: #0af;
}

.team-info {
    margin-bottom: 10px;
    padding: 5px;
    background: rgba(0,0,0,0.5);
    border-radius: 3px;
}

/* Error Message Styles */
.error-message {
    text-align: center;
    color: #ff6b6b;
    padding: 20px;
    margin: 20px;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid #ff6b6b;
    border-radius: 8px;
}

.error-button {
    padding: 10px 20px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.error-button:hover {
    background: #ff5252;
}

/* Team Display Styles */
.team-display.team1 {
    color: #00ff00;
}

.team-display.team2 {
    color: #ff4444;
}

.team-info.team1 {
    border-left: 3px solid #00ff00;
}

.team-info.team2 {
    border-left: 3px solid #ff4444;
}

/* Respawn Countdown Styles */
.hp-text.respawn-countdown {
    color: #ffff00;
}

/* Scoreboard Team Header Styles */
.team-header {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 10px;
    padding: 5px;
    text-align: center;
    border-bottom: 2px solid;
}

.team-header.team1 {
    border-bottom-color: #00ff00;
    color: #00ff00;
}

.team-header.team2 {
    border-bottom-color: #ff4444;
    color: #ff4444;
}

/* Monster Row Styles */
.monster-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 5px;
    margin: 2px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.monster-name-span {
    flex: 1;
    font-size: 12px;
}

.monster-name-span.human {
    color: #ffffff;
    font-weight: bold;
}

.monster-name-span.ai {
    color: #cccccc;
}

.monster-kd-span {
    color: #cccccc;
    font-size: 12px;
}

/* Team Total Row Styles */
.team-total-row {
    font-weight: bold;
    font-size: 14px;
    margin-top: 8px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    display: flex;
    justify-content: space-between;
}

.team-total-label {
    color: #ffffff;
}

.team-total-kd.team1 {
    color: #00ff00;
}

.team-total-kd.team2 {
    color: #ff4444;
}

/* Game Over Screen Styles */
#gameOverScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
    color: white;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.victory-title {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 0 0 20px currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.team1-victory {
    color: #00ff00;
    text-shadow: 0 0 30px #00ff00;
}

.team2-victory {
    color: #ff4444;
    text-shadow: 0 0 30px #ff4444;
}

.final-score {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
    color: #ffffff;
}

.game-over-leaderboard {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    min-width: 500px;
    max-width: 700px;
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-container {
    width: 100%;
}

.leaderboard-title {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    color: #ffffff;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 10px;
}

.leaderboard-team-header {
    font-size: 18px;
    font-weight: bold;
    margin: 15px 0 10px 0;
    padding: 10px;
    text-align: center;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
}

.leaderboard-team-header.team1 {
    color: #00ff00;
    border: 2px solid #00ff00;
}

.leaderboard-team-header.team2 {
    color: #ff4444;
    border: 2px solid #ff4444;
}

.leaderboard-team-header.winning-team {
    background: rgba(255, 215, 0, 0.2);
    animation: winner-glow 2s infinite;
}

@keyframes winner-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
}

.leaderboard-monster-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    margin: 3px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    transition: background 0.3s ease;
}

.leaderboard-monster-row:hover {
    background: rgba(255, 255, 255, 0.1);
}

.monster-rank {
    font-weight: bold;
    color: #FFD700;
    min-width: 40px;
}

.monster-name {
    flex: 1;
    font-weight: bold;
    margin: 0 15px;
}

.monster-name.human {
    color: #ffffff;
    text-shadow: 0 0 5px #ffffff;
}

.monster-name.ai {
    color: #cccccc;
}

.monster-kd {
    color: #ffffff;
    font-weight: bold;
    min-width: 120px;
    text-align: right;
}

.leaderboard-team-total {
    font-weight: bold;
    font-size: 16px;
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
}

.game-over-buttons {
    display: flex;
    gap: 20px;
}

.game-over-btn {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    min-width: 150px;
}

.restart-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.restart-btn:hover {
    background: linear-gradient(45deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.4);
}

.mainmenu-btn {
    background: linear-gradient(45deg, #2196F3, #1976D2);
    color: white;
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.mainmenu-btn:hover {
    background: linear-gradient(45deg, #1976D2, #2196F3);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(33, 150, 243, 0.4);
}

.game-over-btn:active {
    transform: translateY(0);
}

/* Responsive adjustments for game over screen */
@media (max-width: 768px) {
    .victory-title {
        font-size: 36px;
    }
    
    .game-over-leaderboard {
        min-width: 90%;
        max-width: 90%;
        padding: 15px;
    }
    
    .game-over-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .game-over-btn {
        width: 200px;
        padding: 12px 20px;
        font-size: 16px;
    }
}

/* Shop UI Styles */
.shop-ui {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 15px;
    font-family: Arial, sans-serif;
    color: white;
    user-select: none;
    min-width: 280px;
    max-width: 400px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.shop-header {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 5px;
}

.shop-gold {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #FFD700;
    margin-bottom: 15px;
    text-shadow: 0 0 5px #FFD700;
}

.shop-upgrades {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
    justify-items: center;
}

.shop-upgrade-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: Arial, sans-serif;
    font-size: 12px;
    width: 120px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    overflow: hidden;
}

.shop-upgrade-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.shop-upgrade-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.shop-upgrade-btn.disabled {
    background: rgba(255, 0, 0, 0.1);
    border-color: rgba(255, 0, 0, 0.3);
    color: #999;
    cursor: not-allowed;
}

.shop-upgrade-btn.disabled .upgrade-icon-img {
    filter: grayscale(1) opacity(0.3);
}

.shop-upgrade-btn.disabled::after {
    background: rgba(255, 0, 0, 0.3);
    height: 100%;
    border-radius: 8px;
}

.shop-upgrade-btn.disabled:hover {
    background: rgba(255, 0, 0, 0.1);
    border-color: rgba(255, 0, 0, 0.3);
    transform: none;
    box-shadow: none;
}

.upgrade-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.upgrade-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.shop-upgrade-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 50%, transparent 100%);
    border-radius: 0 0 8px 8px;
    z-index: 2;
    pointer-events: none;
}

.upgrade-name {
    font-weight: bold;
    font-size: 11px;
    text-align: center;
    line-height: 1.2;
    margin: 4px 8px 2px 8px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 3;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.upgrade-price {
    font-size: 11px;
    color: #FFD700;
    font-weight: bold;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    margin: 0 8px 8px 8px;
    position: relative;
    z-index: 3;
}

.shop-close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    transition: background 0.3s ease;
}

.shop-close-btn:hover {
    background: rgba(255, 0, 0, 0.9);
}

.shop-feedback {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    animation: shopFeedbackFade 2s ease-out;
}

.shop-feedback.success {
    background: rgba(0, 255, 0, 0.8);
    color: white;
}

.shop-feedback.error {
    background: rgba(255, 0, 0, 0.8);
    color: white;
}

@keyframes shopFeedbackFade {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
}

/* Progress bar styles */
.upgrade-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
    margin: 2px 8px;
    position: relative;
    z-index: 3;
}

.progress-dash {
    width: 12px;
    height: 3px;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.progress-dash.filled {
    background-color: #4CAF50;
    height: 7px;
    width: 14px;
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.6);
}

.progress-dash.empty {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Maxed out upgrade styles */
.shop-upgrade-btn.maxed-out {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.5);
    cursor: default;
}

.shop-upgrade-btn.maxed-out .upgrade-icon-img {
    filter: sepia(1) hue-rotate(90deg) saturate(1.2) brightness(1.1);
}

.shop-upgrade-btn.maxed-out:hover {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.5);
    transform: none;
    box-shadow: none;
}

.shop-upgrade-btn.maxed-out .upgrade-price {
    color: #4CAF50;
    font-weight: bold;
}