body {
    margin: 0;
    overflow: hidden;
    background: #000;
}

canvas {
    width: 100vw;
    height: 100vh;
}

.menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 40px;
    border-radius: 15px;
    color: white;
    text-align: center;
    border: 2px solid #444;
    min-width: 300px;
}

.hidden {
    display: none;
}

#upgradeOptions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.upgrade-btn {
    padding: 15px;
    background: #444;
    border: 2px solid #666;
    color: white;
    cursor: pointer;
    border-radius: 8px;
    font-size: 16px;
    transition: background 0.3s, transform 0.1s;
    width: 100%;
}

.upgrade-btn:hover {
    background: #666;
    transform: scale(1.05);
}

.upgrade-btn.owned {
    background: #2a2a2a;
    cursor: pointer;
    opacity: 0.9;
}

.upgrade-btn.owned:hover {
    transform: scale(1.05);
    background: #3a3a3a;
}

.upgrade-btn.equipped {
    background: #336633;
    border-color: #44ff44;
    cursor: not-allowed;
    box-shadow: 0 0 10px #44ff44;
}

.upgrade-btn.equipped:hover {
    transform: none;
    background: #336633;
}

.upgrade-btn.owned.equipped {
    background: #336633;
    border-color: #44ff44;
    cursor: not-allowed;
    box-shadow: 0 0 10px #44ff44;
}

.upgrade-btn.owned.equipped:hover {
    transform: none;
    background: #336633;
}

.upgrade-btn.locked {
    background: #333;
    border-color: #444;
    cursor: not-allowed;
    opacity: 0.7;
}

.upgrade-btn.locked:hover {
    transform: none;
    background: #333;
}

#stats {
    position: fixed;
    top: 20px;
    left: 20px;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 24px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #444;
}

#stats div {
    margin: 5px 0;
}

#healthBar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 20px;
    background: #333;
    border: 2px solid #444;
    border-radius: 10px;
    overflow: hidden;
}

#healthFill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff0000, #00ff00);
    transition: width 0.3s ease;
}

#shopMenu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 40px;
    border-radius: 15px;
    color: white;
    text-align: center;
    border: 2px solid #444;
    min-width: 300px;
    max-height: 80vh;
    overflow-y: auto;
}

.coin-display {
    color: gold;
    font-weight: bold;
}

.weapons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.start-screen {
    text-align: center;
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.9));
    border: 3px solid #ff3333;
    box-shadow: 0 0 20px #ff0000;
    max-width: 600px;
    margin: auto;
    max-height: 80vh;
    overflow-y: auto;
}

.start-screen h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ff0000;
    text-shadow: 0 0 20px #ff0000;
    font-family: 'Impact', sans-serif;
    letter-spacing: 2px;
}

.start-btn {
    background: linear-gradient(#ff3333, #cc0000);
    color: white;
    padding: 15px 30px;
    font-size: 24px;
    border: none;
    border-radius: 10px;
    margin: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.start-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px #ff0000;
}

.instructions {
    text-align: left;
    margin: 15px 0;
    font-size: 12px;
    color: #ffffff;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    max-height: 50vh;
    overflow-y: auto;
    line-height: 1.1;
}

.instructions h3 {
    color: #00ff00;
    margin: 8px 0 4px 0;
    border-bottom: 1px solid #00ff00;
    padding-bottom: 2px;
    font-size: 14px;
}

.instructions p {
    margin: 2px 0;
}

.key-binding {
    display: inline-block;
    background: #444;
    padding: 1px 4px;
    border-radius: 3px;
    margin: 0 1px;
    font-family: monospace;
    color: #00ff00;
    border: 1px solid #666;
    font-size: 10px;
}

#xpBar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 10px;
    background: #333;
    border: 2px solid #444;
    border-radius: 5px;
    overflow: hidden;
}

#xpFill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00ff00, #33ff33);
    transition: width 0.3s ease;
}

.blue-coin {
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
}

.continue-btn {
    background: linear-gradient(#33cc33, #009900);
    margin-top: 10px;
}

.continue-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px #00ff00;
}

.save-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 255, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.save-notification.show {
    opacity: 1;
}

.zombie-health-bar {
    position: absolute;
    width: 40px;
    height: 4px;
    background: #333;
    border: 1px solid #444;
    border-radius: 2px;
    overflow: hidden;
    pointer-events: none;
}

.zombie-health-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff0000, #ff3333);
    transition: width 0.2s ease;
}

.boss-health-bar {
    width: 60px;
    height: 6px;
    background: #442222;
    border: 2px solid #661111;
}

.boss-health-fill {
    background: linear-gradient(90deg, #ff6600, #ff9933);
}

.compass {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #444;
    display: flex;
    justify-content: center;
    align-items: center;
}

.compass-arrow {
    position: absolute;
    width: 4px;
    height: 40px;
    background: red;
    transform-origin: bottom center;
}

.compass-labels {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.compass-label {
    position: absolute;
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.compass-label.n { 
    top: 5px; 
    left: 50%; 
    transform: translateX(-50%); 
}
.compass-label.s { 
    bottom: 5px; 
    left: 50%; 
    transform: translateX(-50%); 
}
.compass-label.e { 
    right: 5px; 
    top: 50%; 
    transform: translateY(-50%); 
}
.compass-label.w { 
    left: 5px; 
    top: 50%; 
    transform: translateY(-50%); 
}

.character-select {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 15px;
    color: white;
    text-align: center;
    border: 2px solid #444;
    min-width: 300px;
    max-height: 80vh;
    overflow-y: auto;
}

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

.character-card {
    background: rgba(68, 68, 68, 0.5);
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    font-size: 0.9em;
}

.character-card:hover {
    transform: scale(1.05);
    background: rgba(68, 68, 68, 0.8);
}

.character-card.selected {
    border-color: #00ffff;
    box-shadow: 0 0 15px #00ffff;
    transform: scale(1.05);
}

.character-card.unlocked {
    background: rgba(0, 100, 0, 0.5);
    border-color: #00ff00;
}

.character-card.unlocked:hover {
    background: rgba(0, 100, 0, 0.8);
    box-shadow: 0 0 10px #00ff00;
}

.character-card.unlocked.selected {
    border-color: #00ffff;
    box-shadow: 0 0 15px #00ffff;
    transform: scale(1.05);
}

.character-card.locked {
    background: rgba(100, 0, 0, 0.5);
    border-color: #ff0000;
    opacity: 0.5;
    cursor: not-allowed;
}

.character-card.locked:hover {
    background: rgba(100, 0, 0, 0.8);
    box-shadow: 0 0 10px #ff0000;
}

.character-name {
    font-size: 16px;
    margin-bottom: 5px;
    color: #00ff00;
}

.character-card.locked .character-name {
    color: #ff4444;
}

.character-bonus {
    font-size: 12px;
    color: #aaa;
}

.character-description {
    color: #cccccc;
    font-size: 11px;
    margin: 4px 0;
}

.character-requirement {
    color: #ff4444;
    font-size: 12px;
    margin-top: 8px;
}

.character-card.unlocked .character-requirement {
    color: #00ff00;
}

.name-input {
    margin: 10px 0;
}

.name-input input {
    padding: 8px;
    font-size: 14px;
    background: rgba(68, 68, 68, 0.5);
    border: 1px solid #444;
    color: white;
    border-radius: 5px;
    width: 180px;
}

.medic-skill {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: rgba(0, 255, 0, 0.3);
    color: white;
    border-radius: 5px;
    font-size: 18px;
    display: none;
}

.medic-skill.available {
    display: block;
}

.medic-skill.cooldown {
    background: rgba(255, 0, 0, 0.3);
}

.esc-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 40px;
    border-radius: 15px;
    color: white;
    text-align: center;
    border: 2px solid #444;
    min-width: 300px;
    display: none;
}

.esc-menu.active {
    display: block;
}

.esc-menu button {
    background: linear-gradient(#444, #333);
    color: white;
    padding: 15px 30px;
    font-size: 20px;
    border: none;
    border-radius: 8px;
    margin: 10px;
    cursor: pointer;
    width: 200px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.esc-menu button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.options-menu {
    display: none;
    margin-top: 20px;
}

.options-menu.active {
    display: block;
}

.volume-control {
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.volume-control input {
    width: 150px;
}

.back-button {
    background: linear-gradient(#333, #222) !important;
    font-size: 16px !important;
    padding: 10px 20px !important;
}

.pause-screen {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 20px 40px;
    border-radius: 10px;
    color: white;
    font-size: 32px;
    font-weight: bold;
    border: 2px solid #444;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #ff0000;
}

.ability-bar {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.ability-icon {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #444;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.ability-cooldown {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #00ff00;
    transition: width 0.1s linear;
}

.ability-active {
    border-color: #00ff00;
    box-shadow: 0 0 10px #00ff00;
}

.credits {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: #666;
    font-style: italic;
}

.credits-content {
    text-align: center;
    margin: 40px 0;
    font-size: 24px;
    color: #ffffff;
}

.credits-content h2 {
    color: #ff3333;
    margin-bottom: 20px;
}

.credit-link {
    display: inline-block;
    color: #00ff00;
    text-decoration: none;
    margin-left: 10px;
    padding: 5px 15px;
    background: rgba(0, 255, 0, 0.2);
    border-radius: 5px;
    transition: all 0.3s;
}

.credit-link:hover {
    background: rgba(0, 255, 0, 0.4);
    transform: scale(1.1);
}

.quest-tracker {
    position: fixed;
    right: 20px;
    top: 150px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 10px;
    color: white;
    border: 2px solid #444;
    display: none;
}

.quest-timer {
    color: #00ff00;
    font-weight: bold;
    margin-top: 5px;
}

.npc-name {
    position: absolute;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    white-space: nowrap;
    pointer-events: none;
    text-align: center;
}

.dialogue-box {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 10px;
    color: white;
    border: 2px solid #444;
    display: none;
    text-align: center;
    min-width: 300px;
}