* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: #1a1a1a;
            color: #f0f0f0;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            overflow: hidden;
        }

        #gameContainer {
            position: relative;
            width: 100%;
            max-width: 900px;
            height: 100vh;
            max-height: 700px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        #characterSelect {
            background-color: #2a2a2a;
            border-radius: 10px;
            padding: 20px;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
            text-align: center;
            width: 90%;
            max-width: 800px;
        }

        #characterSelect h1 {
            margin-bottom: 20px;
            color: #ff4d4d;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
        }

        /* Tab Styles */
        .tab-container {
            margin-bottom: 20px;
        }

        .tab-buttons {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin-bottom: 20px;
        }

        .tab-button {
            background-color: #444;
            color: #fff;
            border: none;
            padding: 10px 20px;
            border-radius: 5px 5px 0 0;
            cursor: pointer;
            font-weight: bold;
            transition: all 0.3s ease;
        }

        .tab-button:hover {
            background-color: #555;
        }

        .tab-button.active {
            background-color: #ff4d4d;
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        .character-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 15px;
            margin-top: 20px;
        }

        .character-card {
            background-color: #333;
            border-radius: 8px;
            padding: 15px;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 2px solid transparent;
        }

        .character-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 5px 15px rgba(255, 77, 77, 0.3);
            border-color: #ff4d4d;
        }

        .character-card.selected {
            border-color: #4d9dff;
            background-color: #3a3a4a;
        }

        .character-icon {
            font-size: 40px;
            margin-bottom: 10px;
        }

        .character-name {
            font-weight: bold;
            margin-bottom: 5px;
            color: #ff9d4d;
        }

        .character-desc {
            font-size: 12px;
            color: #ccc;
        }

        /* Difficulty Selector */
        .difficulty-selector {
            margin: 20px 0;
            padding: 15px;
            background-color: #333;
            border-radius: 8px;
        }

        .difficulty-selector h3 {
            margin-bottom: 15px;
            color: #ff9d4d;
        }

        .difficulty-options {
            display: flex;
            justify-content: center;
            gap: 15px;
            flex-wrap: wrap;
        }

        .difficulty-option {
            background-color: #444;
            border: 2px solid transparent;
            border-radius: 8px;
            padding: 10px 15px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
            min-width: 120px;
        }

        .difficulty-option:hover {
            background-color: #555;
            transform: translateY(-2px);
        }

        .difficulty-option.selected {
            border-color: #4d9dff;
            background-color: #3a3a4a;
        }

        .difficulty-name {
            font-weight: bold;
            color: #fff;
            margin-bottom: 5px;
        }

        .difficulty-desc {
            font-size: 11px;
            color: #ccc;
        }

        /* Start Button */
        .start-button-container {
            margin-top: 20px;
        }

        .start-button {
            background-color: #4caf50;
            color: white;
            border: none;
            padding: 15px 40px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 18px;
            font-weight: bold;
            transition: all 0.3s ease;
            opacity: 0.5;
            pointer-events: none;
        }

        .start-button.enabled {
            opacity: 1;
            pointer-events: auto;
        }

        .start-button.enabled:hover {
            background-color: #5cbf60;
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
        }

        #gameCanvas {
            border: 2px solid #ff0000;
            background-color: #ff0000;
            display: none;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
            cursor: crosshair;

        }

        #gameUI {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            display: none;
        }

        #healthBar {
            position: absolute;
            bottom: 10px; /* Same level as character icon */
            left: 70px; /* Right next to the character icon */
            width: 200px;
            height: 25px;
            background-color: #333;
            border: 2px solid #555;
            border-radius: 15px;
            overflow: hidden;
            z-index: 10;
        }


        #healthFill {
            height: 100%;
            background-color: #ff4d4d;
            transition: width 0.3s ease;
        }

        #healthText {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: #fff;
            font-weight: bold;
            font-size: 12px;
            text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
            pointer-events: none;
        }

        #waveCounter {
            position: absolute;
            top: 10px; /* Very close to the top edge */
            left: 50%;
            transform: translateX(-50%);
            font-size: 24px;
            font-weight: bold;
            color: #ff9d4d;
            text-align: center;
            z-index: 10;
        }

        #zombieCounter {
            position: absolute;
            top: 40px; /* Right below the wave counter */
            left: 50%;
            transform: translateX(-50%);
            font-size: 20px;
            font-weight: bold;
            color: #ff4d4d;
            text-align: center;
            z-index: 10;
        }


        #characterIcon {
            position: absolute;
            bottom: 10px; /* Very close to the bottom edge */
            left: 10px; /* Very close to the left edge */
            font-size: 36px;
            width: 50px;
            height: 50px;
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: rgba(42, 42, 42, 0.8);
            border-radius: 10px;
            border: 2px solid #555;
            z-index: 10;
        }

        #abilityContainer {
            position: absolute;
            top: 10px; /* Very close to the top edge */
            right: 10px; /* Very close to the right edge */
            display: flex;
            gap: 10px;
            z-index: 10;
        }

        .ability-cube {
            width: 50px;
            height: 50px;
            background-color: rgb(122, 30, 30);
            border: 2px solid #555;
            border-radius: 5px;
            position: relative;
            overflow: hidden;
        }

        .ability-icon {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 24px;
            z-index: 2;
        }

        .ability-cooldown {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            background-color: rgb(0, 0, 0);
            transition: height 0.1s linear;
            z-index: 1;
        }

        #ammoDisplay {
            position: absolute;
            bottom: 10px; /* Same level as health bar */
            left: 280px; /* Right next to the health bar */
            font-size: 16px;
            font-weight: bold;
            color: #4d9dff;
            z-index: 10;
        }

        #shop {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: rgba(30, 30, 30, 0.98);
            border-radius: 10px;
            padding: 20px;
            display: none;
            text-align: center;
            pointer-events: all;
            box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
            z-index: 100;
            max-width: 90%;
            max-height: 80%;
            overflow-y: auto;
        }

        #shop h2 {
            margin-bottom: 10px;
            color: #ffd700;
        }

        #shopCredits {
            margin-bottom: 20px;
            font-size: 18px;
            color: #ffd700;
        }

        .shop-actions {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin-bottom: 20px;
        }

        .shop-action-btn {
            background-color: #444;
            color: #fff;
            border: none;
            padding: 8px 15px;
            border-radius: 5px;
            cursor: pointer;
            font-weight: bold;
            transition: all 0.3s ease;
        }

        .shop-action-btn:hover {
            background-color: #555;
            transform: translateY(-2px);
        }

        .shop-action-btn:disabled {
            background-color: #333;
            color: #666;
            cursor: not-allowed;
            transform: none;
        }

        .shop-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 15px;
            margin-bottom: 20px;
        }

        .shop-card {
            background-color: #333;
            border-radius: 8px;
            padding: 15px;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 2px solid #555;
            position: relative;
            min-height: 180px;
        }

        .shop-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
        }

        .shop-card.common {
            border-color: #888;
        }

        .shop-card.common:hover {
            border-color: #aaa;
            box-shadow: 0 5px 15px rgba(170, 170, 170, 0.3);
        }

        .shop-card.rare {
            border-color: '#4d9dff';
        }

        .shop-card.rare:hover {
            border-color: '#6bb6ff';
            box-shadow: 0 5px 15px rgba(107, 182, 255, 0.3);
        }

        .shop-card.epic {
            border-color: '#9d4dff';
        }

        .shop-card.epic:hover {
            border-color: '#b16bff';
            box-shadow: 0 5px 15px rgba(177, 109, 255, 0.3);
        }

        .shop-card.legendary {
            border-color: '#ff9d4d';
        }

        .shop-card.legendary:hover {
            border-color: '#ffb36d';
            box-shadow: 0 5px 15px rgba(255, 179, 109, 0.3);
        }

        .shop-card.red-path {
            border-color: '#ff4d4d';
        }

        .shop-card.red-path:hover {
            border-color: '#ff6b6b';
            box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
        }

        .shop-card.blue-path {
            border-color: '#4d9dff';
        }

        .shop-card.blue-path:hover {
            border-color: '#6bb6ff';
            box-shadow: 0 5px 15px rgba(107, 182, 255, 0.3);
        }

        .shop-card.affordable {
            border-color: #4caf50;
        }

        .shop-card.affordable:hover {
            border-color: #ffd700;
        }

        .shop-card.purchased {
            opacity: 0.5;
            cursor: not-allowed;
            border-color: #666;
        }

        .shop-card.purchased:hover {
            transform: none;
            box-shadow: none;
        }

        .card-rarity {
            position: absolute;
            top: 5px;
            left: 5px;
            font-size: 10px;
            font-weight: bold;
            padding: 2px 6px;
            border-radius: 10px;
        }

        .card-rarity.common {
            background-color: #888;
            color: #fff;
        }

        .card-rarity.rare {
            background-color: '#4d9dff';
            color: '#fff';
        }

        .card-rarity.epic {
            background-color: '#9d4dff';
            color: '#fff';
        }

        .card-rarity.legendary {
            background-color: '#ff9d4d';
            color: '#fff';
        }

        .card-path {
            position: absolute;
            top: 5px;
            right: 5px;
            font-size: 10px;
            font-weight: bold;
            padding: 2px 6px;
            border-radius: 10px;
        }

        .card-path.red-path {
            background-color: '#ff4d4d';
            color: '#fff';
        }

        .card-path.blue-path {
            background-color: '#4d9dff';
            color: '#fff';
        }

        .card-title {
            font-weight: bold;
            margin-bottom: 10px;
            color: #ff9d4d;
            font-size: 14px;
        }

        .card-desc {
            font-size: 12px;
            color: #ccc;
            margin-bottom: 10px;
        }

        .card-cost {
            position: absolute;
            bottom: 10px;
            right: 10px;
            background-color: '#ffd700';
            color: #000;
            padding: 3px 8px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: bold;
        }

        .card-cost.common {
            background-color: #888;
            color: #fff;
        }

        .card-cost.rare {
            background-color: '#4d9dff';
            color: '#fff';
        }

        .card-cost.epic {
            background-color: '#9d4dff';
            color: '#fff';
        }

        .card-cost.legendary {
            background-color: '#ff9d4d';
            color: '#fff';
        }

        #gameOver {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: rgba(30, 30, 30, 0.95);
            border-radius: 10px;
            padding: 30px;
            text-align: center;
            display: none;
            pointer-events: all;
            box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
            z-index: 100;
        }

        #gameOver h2 {
            margin-bottom: 20px;
            color: '#ff4d4d';
            font-size: 32px;
        }

        #gameOver p {
            margin-bottom: 20px;
            font-size: 18px;
        }

        .btn {
            background-color: '#ff4d4d';
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            transition: all 0.3s ease;
            margin: 5px;
        }

        .btn:hover {
            background-color: '#ff6b6b';
            transform: translateY(-2px);
        }

        #waveNotification {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 48px;
            font-weight: bold;
            color: '#ff4d4d';
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.5s ease;
            z-index: 50;
        }

        .damage-text {
            position: absolute;
            color: '#ff4d4d';
            font-weight: bold;
            font-size: 14px;
            pointer-events: none;
            animation: floatUp 1s ease-out forwards;
        }

        .heal-text {
            position: absolute;
            color: #4caf50;
            font-weight: bold;
            font-size: 14px;
            pointer-events: none;
            animation: floatUp 1s ease-out forwards;
        }

        .credit-text {
            position: absolute;
            color: '#ffd700';
            font-weight: bold;
            font-size: 14px;
            pointer-events: none;
            animation: floatUp 1s ease-out forwards;
        }

        .debug-text {
            position: absolute;
            color: #00ff00;
            font-weight: bold;
            font-size: 12px;
            pointer-events: none;
            animation: floatUp 2s ease-out forwards;
            z-index: 100;
        }

        @keyframes floatUp {
            0% {
                opacity: 1;
                transform: translateY(0);
            }
            100% {
                opacity: 0;
                transform: translateY(-30px);
            }
        }

        /* Debug Button - Right Under Terminal */
        #debugToggle {
            position: absolute;
            bottom: 220px; /* Right under the terminal */
            right: 10px; /* Aligned with the terminal's right edge */
            background-color: #00ff00;
            color: #000;
            border: none;
            padding: 5px 10px;
            border-radius: 3px;
            cursor: pointer;
            font-weight: bold;
            font-size: 12px;
            z-index: 101;
            display: none;
        }

/* Debug Panel - Top Left Edge */
        #debugPanel {
            position: absolute;
            top: 10px; /* Very close to the top edge */
            left: 10px; /* Very close to the left edge */
            background-color: rgba(0, 0, 0, 0.7);
            color: #00ff00;
            padding: 10px;
            border-radius: 5px;
            font-family: monospace;
            font-size: 12px;
            z-index: 100;
            display: none;
            max-width: 300px;
        }

.terminal-container {
  position: fixed;
  bottom: 50px;
  right: 20px;
  width: 300px;
  height: 200px;
  padding: 10px;
  background-image: url("https://upload.wikimedia.org/wikipedia/commons/1/17/Digital_rain_animation_small_letters_clear.gif");
  background-size: cover;
  border-radius: 10px 10px 10px 0;
  border: 3px solid green;
}

#input {
    position: absolute;
  resize: none;
  font-size: 16px;
  color: #fff;
  background-image: url("https://upload.wikimedia.org/wikipedia/commons/1/17/Digital_rain_animation_small_letters_clear.gif");
background-size:contain;
  border: 2px solid green;
  padding: 5px;
  width: calc(100% - 30px);
  height: 60px; /* Changed the height to make room for the button */
  width: 93.5%;
}

#run-btn {
  position: absolute;
  top: 65px;
  left: 120px;
  width: 70px;
  height: 50px;
  font-size: 14px;
  color: #fff;
  background-color: #1d5539;
  border: none;
  cursor: pointer;
  margin-top: 20px;
}
/* Changelog Styles */
.changelog-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    max-height: 80vh;
    background-color: rgba(30, 30, 30, 0.95);
    border: 2px solid #ff4d4d;
    border-radius: 10px;
    padding: 20px;
    color: #f0f0f0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.changelog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
}

.changelog-header h2 {
    margin: 0;
    color: #ff4d4d;
}

.changelog-close {
    font-size: 24px;
    cursor: pointer;
    color: #ff4d4d;
    transition: color 0.3s ease;
}

.changelog-close:hover {
    color: #ff6b6b;
}

.changelog-timer {
    background-color: #333;
    padding: 8px 12px;
    border-radius: 5px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
    color: #ffd700;
}

.changelog-entries {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.changelog-entry {
    background-color: #333;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #ff4d4d;
}

.changelog-entry-title {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 5px;
    color: #ff9d4d;
}

.changelog-entry-date {
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}

.changelog-entry-description {
    font-size: 14px;
    line-height: 1.4;
}

/* Changelog button in terminal */
.changelog-btn {
    background-color: #4d9dff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.changelog-btn:hover {
    background-color: #6bb6ff;
    transform: translateY(-2px);
}