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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    max-width: 1200px;
    width: 100%;
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.back-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.05);
}

h1 {
    color: white;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.info-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 15px 25px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    gap: 15px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-label {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1em;
}

.stat-value {
    font-size: 1.3em;
    font-weight: bold;
    color: #764ba2;
}

.health-bar {
    width: 150px;
    height: 25px;
    background: #ddd;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #667eea;
}

.health-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
    transition: width 0.3s ease;
}

.canvas-wrapper {
    position: relative;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: auto;
    background: linear-gradient(to bottom, #87ceeb 0%, #e0f6ff 100%);
}

.start-screen,
.game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 10;
}

.start-screen h2,
.game-over-screen h2 {
    font-size: 3em;
    margin-bottom: 20px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
}

.instructions {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.instructions p {
    margin: 10px 0;
    font-size: 1.2em;
}

.start-btn,
.restart-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 15px 50px;
    font-size: 1.5em;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

.start-btn:hover,
.restart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(245, 87, 108, 0.6);
}

.start-btn:active,
.restart-btn:active {
    transform: scale(0.98);
}

.game-over-screen p {
    font-size: 1.5em;
    margin: 10px 0;
}

.hidden {
    display: none !important;
}

/* Mobile Controls */
.mobile-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 20px;
}

.control-section {
    display: flex;
    gap: 10px;
}

.control-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.move-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.action-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.control-btn:active {
    transform: scale(0.9);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.instructions-text {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.instructions-text h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.instructions-text ul {
    list-style: none;
    padding: 0;
}

.instructions-text li {
    padding: 8px 0;
    font-size: 1.1em;
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8em;
    }

    .back-btn {
        position: static;
        transform: none;
        display: inline-block;
        margin-bottom: 15px;
    }

    .info-panel {
        flex-direction: column;
        gap: 10px;
    }

    .health-bar {
        width: 200px;
    }

    .start-screen h2,
    .game-over-screen h2 {
        font-size: 2em;
    }

    .instructions {
        padding: 15px 25px;
    }

    .instructions p {
        font-size: 1em;
    }

    .mobile-controls {
        display: flex !important;
    }
}

/* Level Up Notification */
.level-up-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 40px 60px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(245, 87, 108, 0.6);
    z-index: 1000;
    text-align: center;
    animation: levelUpPop 0.5s ease-out;
}

@keyframes levelUpPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.level-up-notification.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.9);
    }
}

.level-up-notification h2 {
    font-size: 2.5em;
    margin-bottom: 15px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
}

.level-up-notification p {
    font-size: 1.2em;
    margin: 8px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8em;
    }

    .back-btn {
        position: static;
        transform: none;
        display: inline-block;
        margin-bottom: 15px;
    }

    .info-panel {
        flex-direction: column;
        gap: 10px;
    }

    .health-bar {
        width: 200px;
    }

    .start-screen h2,
    .game-over-screen h2 {
        font-size: 2em;
    }

    .instructions {
        padding: 15px 25px;
    }

    .instructions p {
        font-size: 1em;
    }

    .mobile-controls {
        display: flex !important;
    }
    
    .level-up-notification {
        padding: 30px 40px;
    }
    
    .level-up-notification h2 {
        font-size: 1.8em;
    }
    
    .level-up-notification p {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.5em;
    }

    .info-panel {
        padding: 10px 15px;
    }

    .stat-label,
    .stat-value {
        font-size: 0.9em;
    }

    .control-btn {
        width: 60px;
        height: 60px;
        font-size: 1.2em;
    }
}
