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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    animation: bgShift 20s ease infinite;
}

@keyframes bgShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

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

#gameCanvas {
    border: 3px solid #1a2e20;
    background: #1a2620;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 100px rgba(52, 152, 219, 0.3);
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    pointer-events: none;
    z-index: 10;
}

.hud-section {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 20px;
    border-radius: 10px;
    border: 2px solid #0f3460;
    backdrop-filter: blur(10px);
}

.stat-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.stat-bar:last-child {
    margin-bottom: 0;
}

.stat-label {
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    min-width: 30px;
}

.bar-container {
    position: relative;
    width: 200px;
    height: 24px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #0f3460;
    border-radius: 12px;
    overflow: hidden;
}

.bar {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.health-bar {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.xp-bar {
    background: linear-gradient(90deg, #3498db, #2980b9);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.stat-item {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-item span {
    color: #3498db;
}

.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 40px;
    border-radius: 20px;
    border: 3px solid #0f3460;
    box-shadow: 0 0 50px rgba(52, 152, 219, 0.3);
    text-align: center;
    max-width: 600px;
    animation: modalPop 0.3s ease;
}

@keyframes modalPop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content h1,
.modal-content h2 {
    color: #3498db;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.modal-content p {
    color: #fff;
    font-size: 18px;
    margin-bottom: 15px;
}

.upgrade-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.upgrade-btn {
    background: linear-gradient(135deg, #2980b9, #3498db);
    color: #fff;
    border: 2px solid #0f3460;
    padding: 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: left;
    pointer-events: all;
}

.upgrade-btn:hover {
    background: linear-gradient(135deg, #3498db, #5dade2);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.5);
}

.upgrade-btn .upgrade-title {
    font-size: 18px;
    margin-bottom: 5px;
}

.upgrade-btn .upgrade-desc {
    font-size: 14px;
    opacity: 0.9;
}

.btn {
    background: linear-gradient(135deg, #2980b9, #3498db);
    color: #fff;
    border: 2px solid #0f3460;
    padding: 15px 40px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: 20px;
    pointer-events: all;
}

.btn:hover {
    background: linear-gradient(135deg, #3498db, #5dade2);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, #7f8c8d, #95a5a6);
    border: 2px solid #34495e;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #95a5a6, #bdc3c7);
    box-shadow: 0 5px 20px rgba(149, 165, 166, 0.5);
}

.game-over-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

#controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.control-hint {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid #0f3460;
    backdrop-filter: blur(10px);
    font-size: 14px;
    font-weight: bold;
}

.skills-bar {
    display: flex;
    gap: 10px;
}

.skill-slot {
    position: relative;
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid #0f3460;
    border-radius: 10px;
    padding: 12px;
    min-width: 80px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.skill-slot.active {
    border-color: #e74c3c;
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.6);
    animation: pulse 0.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.skill-slot.cooldown {
    opacity: 0.5;
}

.skill-key {
    background: #3498db;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin: 0 auto 8px;
}

.skill-name {
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.skill-cooldown {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #3498db;
    border-radius: 0 0 7px 7px;
    transition: width 0.1s linear;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.character-select-content {
    max-width: 900px;
    padding: 30px;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.character-card {
    background: linear-gradient(135deg, #0f3460, #16213e);
    border: 3px solid #0f3460;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    pointer-events: all;
}

.character-card:hover {
    border-color: #3498db;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(52, 152, 219, 0.4);
}

.character-card.selected {
    border-color: #2ecc71;
    background: linear-gradient(135deg, #0f3460, #1a5c3e);
    box-shadow: 0 0 30px rgba(46, 204, 113, 0.5);
}

.character-preview {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    border-radius: 50%;
    border: 3px solid #0f3460;
    position: relative;
}

.warrior-preview {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.5);
}

.warrior-preview::before {
    content: '⚔️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
}

.ranger-preview {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.5);
}

.ranger-preview::before {
    content: '🏹';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
}

.mage-preview {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.5);
}

.mage-preview::before {
    content: '🔮';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
}

.bomber-preview {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.5);
}

.bomber-preview::before {
    content: '💣';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
}

.character-card h3 {
    color: #3498db;
    margin-bottom: 10px;
}

.character-stat {
    color: #bdc3c7;
    font-size: 14px;
    margin: 5px 0;
}

/* Skill Shop Styles */
.coin-display {
    background: rgba(241, 196, 15, 0.2);
    border: 2px solid #f1c40f;
    border-radius: 10px;
    padding: 10px 20px;
    margin: 15px 0;
    font-size: 24px;
    font-weight: bold;
    color: #f1c40f;
    text-align: center;
}

.coin-display-large {
    background: rgba(241, 196, 15, 0.2);
    border: 3px solid #f1c40f;
    border-radius: 15px;
    padding: 15px 30px;
    margin: 20px auto;
    font-size: 36px;
    font-weight: bold;
    color: #f1c40f;
    text-align: center;
    max-width: 300px;
}

.shop-content {
    min-width: 700px;
    max-width: 900px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.skill-card {
    background: rgba(26, 46, 96, 0.8);
    border: 3px solid #3498db;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.skill-card.unlocked {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.2);
}

.skill-card.locked {
    opacity: 0.7;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.5);
}

.skill-card h3 {
    color: #3498db;
    margin-bottom: 10px;
    font-size: 20px;
}

.skill-card.unlocked h3 {
    color: #2ecc71;
}

.skill-card p {
    color: #bdc3c7;
    font-size: 14px;
    margin: 8px 0;
}

.skill-price {
    background: rgba(241, 196, 15, 0.3);
    border: 2px solid #f1c40f;
    border-radius: 8px;
    padding: 8px;
    margin: 10px 0;
    font-size: 18px;
    font-weight: bold;
    color: #f1c40f;
}

.skill-card.unlocked .skill-price {
    background: rgba(46, 204, 113, 0.3);
    border-color: #2ecc71;
    color: #2ecc71;
}

.unlock-btn {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    border: 2px solid #d68910;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: 10px;
    width: 100%;
}

.unlock-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #e67e22, #d35400);
    transform: translateY(-2px);
}

.unlock-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

