@font-face {
    font-family: 'Picotron';
    src: url('assets/picotron.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

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

body {
    font-family: 'Picotron', 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #fff;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 800px;
    height: 600px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow: hidden;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgb(60, 60, 85) 0%, rgb(47, 42, 67) 100%);
    cursor: none; /* Hide cursor - we use arrow sprite instead */
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* Enemy Panel */
#enemy-panel {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    min-width: 280px;
}

.enemy-name {
    font-size: 16px;
    font-weight: bold;
    color: #ff6b6b;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.health-bar-container {
    position: relative;
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(233, 69, 96, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.health-bar {
    height: 100%;
    background: linear-gradient(90deg, #e94560 0%, #ff6b6b 100%);
    transition: width 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.health-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 1);
    z-index: 1;
}

/* Player Panel */
#player-panel {
    position: absolute;
    bottom: 40px;
    left: 20px;
    min-width: 200px;
}

.player-bars {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Armor Bar (Green, on top) - Segmented Display */
.armor-bar-container {
    position: relative;
    width: 100%;
    min-height: 10px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    overflow: visible;
    border: none;
    box-shadow: none;
    margin-bottom: 3px;
}

.armor-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: bold;
    color: #2ecc71;
    text-shadow: 
        0 0 4px rgba(0, 0, 0, 0.9),
        0 0 8px rgba(46, 204, 113, 0.6),
        1px 1px 2px rgba(0, 0, 0, 1);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    pointer-events: none;
    width: 100%;
}

/* Player Health Bar (Red, below armor) */
.player-health-bar-container {
    position: relative;
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(231, 76, 60, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.player-health-bar {
    height: 100%;
    background: linear-gradient(90deg, #c0392b 0%, #e74c3c 100%);
    transition: width 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.player-health-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 1);
    z-index: 1;
}

/* Player Gold Display (no bounding box) */
#player-gold-display {
    position: absolute;
    bottom: 80px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gold-icon {
    font-size: 24px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
}

.gold-value {
    font-size: 20px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 
        2px 2px 0px #8b6914,
        3px 3px 6px rgba(0, 0, 0, 0.8);
}

/* Item Display (below player HP bar, left side) */
#item-display {
    position: absolute;
    bottom: 5px;
    left: 20px;
    display: none; /* Hidden by default, shown when items exist */
    gap: 3px;
    padding: 0;
    background: none;
    border: none;
    z-index: 5;
    pointer-events: none;
}

.item-icon {
    width: 16px;
    height: 16px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.item-icon img {
    width: 12px;
    height: 12px;
    object-fit: contain;
    image-rendering: pixelated;
}

/* Level Display (top left) */
#level-display {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 1);
    z-index: 5;
    pointer-events: none;
}

#current-level {
    color: #4ecca3;
}

/* Dev Tool - Win Button */
#dev-win-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 0, 0, 0.3);
    border: 3px solid #ff0000;
    border-radius: 10px;
    padding: 15px 20px;
    font-size: 14px;
    font-weight: bold;
    color: #ff6b6b;
    text-align: center;
    pointer-events: none;
    z-index: 5;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
    animation: devPulse 2s ease-in-out infinite;
}

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

/* Shooter Inventory */
#shooter-inventory {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 12px;
    border-radius: 10px;
    border: 2px solid #4ecca3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.inventory-hint {
    text-align: center;
    font-size: 10px;
    color: #aaa;
    margin-bottom: 6px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

#marble-slots {
    display: flex;
    gap: 10px;
}

.marble-slot {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.marble-slot.active {
    border-color: #4ecca3;
    box-shadow: 0 0 15px rgba(78, 204, 163, 0.5);
    transform: scale(1.1);
}

.marble-slot img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* Floating Damage Numbers */
#floating-numbers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
}

.floating-number {
    position: absolute;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 1);
    animation: floatUp 1.5s ease-out forwards;
    pointer-events: none;
    font-family: 'Picotron', 'Courier New', monospace;
}

.floating-number.damage {
    color: #ff6b6b;
}

.floating-number.armor {
    color: #4ecca3;
}

.floating-number.gold {
    color: #ffd93d;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-30px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.8);
    }
}

/* Screen Overlays (Victory, Map, Shop) */
.screen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: all;
}

/* Victory Screen */
.victory-panel {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    border: 3px solid #4ecca3;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    max-width: 700px;
}

.victory-title {
    font-size: 48px;
    color: #ffd93d;
    text-shadow: 0 0 20px rgba(255, 217, 61, 0.8);
    margin-bottom: 10px;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.victory-subtitle {
    font-size: 20px;
    color: #fff;
    margin-bottom: 30px;
}

.upgrade-choices {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.upgrade-card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(78, 204, 163, 0.5);
    border-radius: 15px;
    padding: 20px;
    width: 180px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upgrade-card:hover {
    transform: translateY(-10px);
    border-color: #4ecca3;
    box-shadow: 0 10px 30px rgba(78, 204, 163, 0.5);
    background: rgba(78, 204, 163, 0.2);
}

.upgrade-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
}

.upgrade-name {
    font-size: 18px;
    color: #4ecca3;
    margin-bottom: 10px;
}

.upgrade-description {
    font-size: 12px;
    color: #ccc;
    line-height: 1.4;
}

/* Map Screen */
.map-panel {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    border: 3px solid #4ecca3;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    max-width: 700px;
    width: 90%;
}

.map-title {
    font-size: 36px;
    color: #4ecca3;
    margin-bottom: 20px;
}

.map-container {
    width: 600px;
    height: 400px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    border: 2px solid rgba(78, 204, 163, 0.3);
}

#map-canvas {
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Shop Screen */
.shop-panel {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    border: 3px solid #ffd93d;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    max-width: 700px;
}

.shop-title {
    font-size: 36px;
    color: #ffd93d;
    margin-bottom: 20px;
}

.shop-gold-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
    font-size: 28px;
}

.shop-items {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
}

.shop-item {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 217, 61, 0.5);
    border-radius: 15px;
    padding: 20px;
    width: 180px;
}

.shop-item-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
}

.shop-item-name {
    font-size: 18px;
    color: #ffd93d;
    margin-bottom: 10px;
}

.shop-item-description {
    font-size: 12px;
    color: #ccc;
    margin-bottom: 15px;
    line-height: 1.4;
}

.shop-buy-btn {
    background: linear-gradient(135deg, #ffd93d 0%, #ffaa00 100%);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-family: 'Picotron', 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shop-buy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 217, 61, 0.5);
}

.shop-buy-btn:active {
    transform: scale(0.95);
}

.shop-leave-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 30px;
    font-family: 'Picotron', 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shop-leave-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.5);
}

/* Responsive adjustments */
@media (max-width: 900px) {
    #game-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
}

