* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #111;
    color: #fff;
    overflow: hidden;
}

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

.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10;
    padding: 20px;
}

.hidden {
    display: none;
}

h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
    text-align: center;
    color: #4ff;
    text-shadow: 0 0 10px #0ff, 0 0 20px #0ff;
    animation: glow 2s ease-in-out infinite alternate;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #4ff;
}

.menu-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    width: 90%;
    max-width: 1200px;
    margin-bottom: 2rem;
}

.instructions, .weapon-info, .tiers-info {
    background-color: rgba(0, 150, 200, 0.2);
    border: 1px solid #4ff;
    border-radius: 10px;
    padding: 15px;
    margin: 10px;
    flex: 1 1 300px;
    max-width: 350px;
}

.button {
    background-color: #0a6;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(0, 200, 100, 0.5);
}

.button:hover {
    background-color: #0c8;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 200, 100, 0.8);
}

#game-canvas {
    background-color: #000;
    display: block;
    margin: 0 auto;
}

#hud {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 5px;
    border: 1px solid #4ff;
}

#stats {
    display: flex;
    gap: 15px;
}

#stats div {
    padding: 5px 10px;
    border-radius: 5px;
    background-color: rgba(0, 100, 150, 0.3);
}

#health {
    color: #f44;
}

#shield {
    color: #44f;
}

#gold {
    color: #fd4;
}

#weapons-container {
    display: flex;
    gap: 5px;
}

.weapon-slot {
    width: 40px;
    height: 40px;
    background-color: rgba(50, 50, 50, 0.5);
    border: 1px solid #999;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    position: relative;
}

.weapon-slot.active {
    border-color: #4ff;
    box-shadow: 0 0 10px #4ff;
}

.weapon-slot .weapon-icon {
    font-size: 1.5rem;
}

.weapon-slot .tier {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 0.7rem;
    padding: 2px 4px;
    border-radius: 3px;
    background-color: #333;
}

/* Shop styling */
#shop-screen {
    justify-content: flex-start;
    padding-top: 50px;
}

#gold-display {
    font-size: 1.5rem;
    color: #fd4;
    margin-bottom: 20px;
}

/* Shop items: two column responsive layout */
#shop-items {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
}

/* stack to single column on narrow screens */
@media (max-width: 700px) {
    #shop-items {
        grid-template-columns: 1fr;
    }
}

.shop-item {
    background-color: rgba(40, 40, 60, 0.7);
    border: 1px solid #4ff;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.shop-item .weapon-name {
    font-size: 1.2rem;
    font-weight: bold;
}

.shop-item .weapon-icon {
    font-size: 2rem;
    margin: 10px 0;
}

.shop-item .weapon-stats {
    font-size: 0.9rem;
    width: 100%;
}

.shop-item .price {
    color: #fd4;
    font-weight: bold;
}

.shop-item button {
    background-color: #0a6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
}

.shop-item button:disabled {
    background-color: #555;
    cursor: not-allowed;
}

#inventory {
    width: 90%;
    max-width: 800px;
    margin-top: 20px;
}

#inventory-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.inventory-item {
    background-color: rgba(40, 40, 60, 0.7);
    border: 1px solid #999;
    border-radius: 5px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.inventory-item .weapon-icon {
    font-size: 1.5rem;
}

.inventory-item .tier-badge {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.7rem;
    padding: 2px 4px;
    border-radius: 0 5px 0 5px;
}

/* Tier colors */
.common {
    color: #fff;
    border-color: #ccc;
}

.rare {
    color: #4af;
    border-color: #4af;
}

.epic {
    color: #a4f;
    border-color: #a4f;
}

.epic-plus {
    color: #f4a;
    border-color: #f4a;
}

.legendary {
    color: #fd4;
    border-color: #fd4;
    text-shadow: 0 0 5px #fd4;
}

/* Skill screen */
#skill-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.skill-option {
    background-color: rgba(40, 40, 60, 0.7);
    border: 1px solid #4ff;
    border-radius: 10px;
    padding: 15px;
    width: 200px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.skill-option:hover {
    background-color: rgba(60, 60, 80, 0.7);
    transform: scale(1.05);
}

.skill-option.selected {
    border-color: #0f6;
    box-shadow: 0 0 15px #0f6;
}

.skill-option .skill-icon {
    font-size: 2rem;
    margin: 10px 0;
}

/* Game over screen */
#game-over {
    justify-content: center;
}

#final-stats {
    background-color: rgba(40, 40, 60, 0.7);
    border: 1px solid #4ff;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    font-size: 1.2rem;
}

#final-stats p {
    margin: 10px 0;
}

/* Animations */
@keyframes glow {
    from {
        text-shadow: 0 0 10px #0ff, 0 0 20px #0ff;
    }
    to {
        text-shadow: 0 0 15px #0ff, 0 0 30px #0ff, 0 0 40px #0ff;
    }
}

/* Health bars */
.health-bar {
    height: 5px;
    background-color: #333;
    margin-top: 5px;
    position: relative;
    border-radius: 2px;
    overflow: hidden;
}

.health-bar-fill {
    height: 100%;
    background-color: #f44;
    width: 100%;
    transition: width 0.3s;
}

.boss-health-bar {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 10px;
    background-color: #333;
    border-radius: 5px;
    overflow: hidden;
}

.boss-health-bar-fill {
    height: 100%;
    background-color: #f44;
    width: 100%;
    transition: width 0.3s;
}

.boss-health-label {
    position: absolute;
    top: 35px;
    left: 50%;
    transform: translateX(-50%);
    color: #f44;
    font-weight: bold;
    text-shadow: 0 0 5px #000;
}

/* Damage numbers and pop-ups */
.damage-number {
    position: absolute;
    color: #f44;
    font-weight: bold;
    font-size: 16px;
    animation: float-up 1s forwards;
    text-shadow: 0 0 3px #000;
}

.gold-pickup {
    position: absolute;
    color: #fd4;
    font-weight: bold;
    font-size: 14px;
    animation: float-up 1s forwards;
    text-shadow: 0 0 3px #000;
}

@keyframes float-up {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px);
    }
}

.teleport-effect, .gold-pickup, .heal-effect {
    transform: translate(-50%, -100%); /* center horizontally, place above */
    pointer-events: none;
}

.teleport-effect {
    background: transparent;
    font-size: 20px;
    text-shadow: 0 0 6px #fff;
}

#powerups-display {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: 10px;
}

.powerup-badge {
    background: rgba(255,255,255,0.06);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid rgba(255,255,255,0.08);
}