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

body {
    overflow: hidden;
    background: #87CEEB;
    font-family: 'Courier New', monospace;
}

canvas {
    display: block;
}

#blocker {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    cursor: pointer;
}

#blocker.hidden {
    display: none;
}

#instructions {
    color: #fff;
    text-align: center;
}

#instructions h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #d4a017;
    text-shadow: 2px 2px 0 #000, 0 0 20px rgba(212, 160, 23, 0.5);
    letter-spacing: 6px;
}

#instructions p {
    font-size: 18px;
    margin-bottom: 10px;
}

#instructions .controls {
    font-size: 14px;
    color: #aaa;
    line-height: 1.8;
}

#crosshair {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    z-index: 10;
    pointer-events: none;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
    display: none;
}

/* HUD */
#hud {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 10;
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

#health-bar-container {
    width: 200px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #555;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

#health-bar-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #cc0000, #ff3333, #00cc00);
    transition: width 0.3s ease;
}

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

#weapon-display {
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 12px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    display: flex;
    gap: 12px;
    align-items: center;
}

#weapon-name {
    color: #aaa;
}

#ammo-count {
    color: #ffcc00;
    font-weight: bold;
}

#ammo-count::before {
    content: "Ammo: ";
    color: #888;
    font-weight: normal;
}

/* Damage overlay */
#damage-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255, 0, 0, 0.3);
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.1s ease;
}

#damage-overlay.flash {
    opacity: 1;
}

/* Debug info */
#debug {
    position: fixed;
    top: 10px;
    left: 10px;
    color: #fff;
    font-size: 12px;
    z-index: 10;
    text-shadow: 1px 1px 0 #000;
    display: none;
    line-height: 1.6;
}

/* Modals */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #1a1a2e;
    border: 2px solid #444;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    color: #fff;
    min-width: 350px;
}

.modal-content h2 {
    font-size: 36px;
    margin-bottom: 20px;
    letter-spacing: 3px;
}

#victory-modal .modal-content h2 {
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

#gameover-modal .modal-content h2 {
    color: #ff4444;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
}

#gameover-modal .modal-content p {
    color: #aaa;
    margin-bottom: 24px;
    font-size: 16px;
}

/* Reward box */
#reward-box {
    border: 3px solid #888;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    background: rgba(0, 0, 0, 0.4);
}

#reward-rarity {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

#reward-name {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 8px;
}

#reward-desc {
    font-size: 14px;
    color: #aaa;
}

/* Rarity colors applied via JS on the reward-box border + reward-rarity text */
.rarity-common     { border-color: #aaaaaa !important; }
.rarity-uncommon   { border-color: #44bb44 !important; }
.rarity-rare       { border-color: #4488ff !important; }
.rarity-epic       { border-color: #bb44ff !important; }
.rarity-legendary  { border-color: #ffaa00 !important; }

.rarity-text-common     { color: #aaaaaa; }
.rarity-text-uncommon   { color: #44bb44; }
.rarity-text-rare       { color: #4488ff; }
.rarity-text-epic       { color: #bb44ff; }
.rarity-text-legendary  { color: #ffaa00; }

/* Buttons */
.modal-content button {
    background: #2a6e2a;
    color: #fff;
    border: 2px solid #3a8e3a;
    padding: 12px 32px;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    border-radius: 6px;
    letter-spacing: 1px;
    transition: background 0.2s;
}

.modal-content button:hover {
    background: #3a8e3a;
}

#gameover-modal button {
    background: #6e2a2a;
    border-color: #8e3a3a;
}

#gameover-modal button:hover {
    background: #8e3a3a;
}
