/* TankTown Cute Style – Complete Visual Overhaul */

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

body {
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    overflow-x: hidden;
}

#login {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    margin: 50px auto;
    backdrop-filter: blur(10px);
}

#login h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input, select, button {
    padding: 12px 16px;
    margin: 8px;
    border-radius: 12px;
    border: 2px solid #e1e5e9;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 300px;
}

input:focus, select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 0.5px;
    margin-top: 10px;
}

button:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(-1px);
}

#gameArea {
    margin-top: 20px;
}

canvas {
    background: linear-gradient(160deg, #2c3e50, #4a6572);
    display: block;
    margin: 0 auto;
    border: 4px solid #34495e;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

canvas.pulse {
    animation: pulseBorder 0.8s ease-out;
}

@keyframes pulseBorder {
    0% {
        border-color: #66ccff;
        box-shadow: 0 0 20px rgba(102, 204, 255, 0.8);
    }
    50% {
        border-color: #ff6f91;
        box-shadow: 0 0 35px rgba(255, 111, 145, 1);
    }
    100% {
        border-color: #34495e;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    }
}

#info {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 12px;
    margin: 15px auto;
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Leaderboard panel */
#leaderboard {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    text-align: left;
    max-width: 250px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

#leaderboard h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #2c3e50;
    text-align: center;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 8px;
}

/* Animated leaderboard rows */
#leaderboard-content div {
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 6px;
    border-left: 4px solid transparent;
}

#leaderboard-content div.kill {
    background-color: #ffeaa7;
    border-left-color: #fdcb6e;
    animation: highlight 1s ease-out;
}

#leaderboard-content div.levelup {
    background-color: #ff7675;
    border-left-color: #d63031;
    animation: highlight 1s ease-out;
}

#leaderboard-content div.team-red {
    border-left-color: #e74c3c;
    background: linear-gradient(90deg, rgba(231, 76, 60, 0.1), transparent);
}

#leaderboard-content div.team-blue {
    border-left-color: #3498db;
    background: linear-gradient(90deg, rgba(52, 152, 219, 0.1), transparent);
}

#leaderboard-content div:hover {
    transform: translateX(5px) scale(1.02);
    background-color: #ecf0f1;
}

@keyframes highlight {
    0% {
        background-color: #ffeaa7;
        transform: scale(1);
    }
    50% {
        background-color: #fd79a8;
        transform: scale(1.05);
    }
    100% {
        background-color: #ffeaa7;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* Power-up glow animation */
.power-up {
    animation: glowPulse 1.5s infinite alternate;
}

.power-up.shield {
    background: linear-gradient(45deg, #00b894, #00ff99);
    box-shadow: 0 0 20px #00ff99, 0 0 30px #00ff99;
}

.power-up.double {
    background: linear-gradient(45deg, #fdcb6e, #ffff66);
    box-shadow: 0 0 20px #ffff66, 0 0 30px #ffff66;
}

@keyframes glowPulse {
    0% {
        transform: scale(1) rotate(0deg);
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
    }
    50% {
        transform: scale(1.1) rotate(180deg);
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.9);
    }
    100% {
        transform: scale(1) rotate(360deg);
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
    }
}

/* Player level-up sparkle animation */
.player-sparkle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffdd00, #ff6b6b);
    animation: sparkle 0.8s ease-out forwards;
    pointer-events: none;
}

@keyframes sparkle {
    0% { 
        opacity: 1; 
        transform: scale(1) translate(0, 0); 
    }
    50% { 
        opacity: 1; 
        transform: scale(2) translate(0, -15px); 
    }
    100% { 
        opacity: 0; 
        transform: scale(0.5) translate(0, -25px); 
    }
}

/* Explosion effects */
.explosion {
    position: absolute;
    pointer-events: none;
    animation: explode 0.6s ease-out forwards;
}

@keyframes explode {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.7;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    #leaderboard {
        position: relative;
        top: auto;
        right: auto;
        max-width: 100%;
        margin: 20px auto;
    }
    
    canvas {
        width: 95%;
        height: auto;
    }
    
    #login {
        margin: 20px auto;
        padding: 20px;
    }
}

/* Installation Prompt */
.install-prompt {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.install-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    margin: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.install-content h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 24px;
}

.install-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 25px;
}

.install-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.install-btn {
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.android-btn {
    background: linear-gradient(135deg, #3ddc84, #34a853);
}

.ios-btn {
    background: linear-gradient(135deg, #007aff, #5856d6);
}

.pwa-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.install-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Mobile App Links in Login */
.mobile-app-links {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-align: center;
}

.mobile-app-links p {
    color: #2c3e50;
    margin-bottom: 10px;
}

.mobile-app-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.mobile-app-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Crosshair for aiming */
#crosshair {
    position: fixed;
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 100;
    background: radial-gradient(circle, #ff0000, transparent 70%);
    border: 2px solid #ff0000;
    border-radius: 50%;
    opacity: 0.8;
}

/* 3D Tank Styles */
.tank-3d {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.1s ease;
}

.tank-body {
    position: relative;
    background: linear-gradient(135deg, #7f8c8d, #95a5a6);
    border-radius: 8px 8px 15px 15px;
    box-shadow: 
        inset 0 -5px 10px rgba(0,0,0,0.3),
        0 5px 15px rgba(0,0,0,0.2);
}

.tank-turret {
    position: absolute;
    background: linear-gradient(135deg, #34495e, #2c3e50);
    border-radius: 5px;
    transform-origin: center bottom;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.tank-barrel {
    position: absolute;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: 3px;
    transform-origin: left center;
}

/* Enhanced 3D Effects */
.tank-shadow {
    position: absolute;
    background: radial-gradient(ellipse, rgba(0,0,0,0.4), transparent 70%);
    border-radius: 50%;
    filter: blur(5px);
}

/* Aim Indicator */
.aim-indicator {
    background: rgba(44, 62, 80, 0.9);
    color: #ecf0f1;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
    border-left: 4px solid #e74c3c;
}

/* Enhanced Game Stats */
.game-stats {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 12px;
    margin: 15px auto;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.3);
}

/* 3D Power-ups */
.power-up-3d {
    position: relative;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border-radius: 50%;
    box-shadow: 
        0 10px 20px rgba(0,0,0,0.3),
        inset 0 -5px 10px rgba(0,0,0,0.2);
    transform-style: preserve-3d;
    animation: float3d 3s ease-in-out infinite;
}

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

/* Enhanced Bullets with 3D trail */
.bullet-3d {
    position: relative;
    background: linear-gradient(135deg, #f1c40f, #e67e22);
    border-radius: 50%;
    box-shadow: 0 0 10px #f1c40f;
}

.bullet-trail {
    position: absolute;
    background: linear-gradient(90deg, transparent, #f39c12, transparent);
    border-radius: 50%;
    filter: blur(3px);
    opacity: 0.7;
}

/* Mobile responsive improvements */
@media (max-width: 768px) {
    .install-content {
        margin: 10px;
        padding: 20px;
    }
    
    .install-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .game-stats {
        margin: 10px;
        padding: 10px;
    }
}

/* 3D Transformations for tanks */
@keyframes tankMove {
    0% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-2px) rotate(-1deg); }
    75% { transform: translateY(2px) rotate(1deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

.tank-moving {
    animation: tankMove 0.3s ease-in-out infinite;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}