@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');


* {
    box-sizing: border-box;
}

.battle-wrapper {
    text-align: center;
    color: #f5e6c8;
    font-family: 'Press Start 2P', cursive;
    background: radial-gradient(circle, #2c1b0f, #120a05);
    padding: 20px;
}

h2 {
    color: #ffd27d;
    text-shadow: 2px 2px #000;
}

/* =========================
       KAMPFBILDSCHIRM
    ========================= */

.battle-scene {
    position: relative;
    width: 640px;
    height: 360px;
    margin: auto;

    background: url("background_1.png") center/cover no-repeat;
    border: 4px solid #c9a44c;
    box-shadow: 0 0 25px #000;

    overflow: hidden;
}

.battle-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 50;
}

.potion-menu {
    pointer-events: all;
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #666;
    padding: 16px;
    border-radius: 10px;
    min-width: 260px;


    display: flex;
    flex-direction: column;
    gap: 10px;
}

.potion-menu button {
    padding: 8px;
    cursor: pointer;
    font-family: 'Press Start 2P', cursive;
    color: #030303;
    font-size: 0.7em;
    background-color: #ffd27d;
}

/* =========================
       SPRITES
    ========================= */

#enemy-sprite,
#player-sprite {
    width: 110px;
    image-rendering: pixelated;
    position: absolute;
}

#enemy-sprite {
    top: 40px;
    left: 60px;
}

#player-sprite {
    bottom: 80px;
    right: 80px;
}

/* =========================
       MAP
    ========================= */

.map-container {
    /*Original ist 1536 x 1024 */
    position: relative;
    width: 800px;
    height: 530px;
    margin: 0px auto;

    border: 3px solid #c9a44c;
    box-shadow: 0 0 15px black;
}

.world-map {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Basis für alle Map-Buttons */
.map-button {
    position: absolute;
    width: auto !important;
    padding: 8px 10px;
    font-size: 8px;

    background: #5a3e1b;
    color: #ffd27d;
    border: 2px solid #c9a44c;
    cursor: pointer;

    white-space: nowrap;
}

.map-button.complete {
    border-color: gold;
}

/* FIXE POSITIONEN (PIXEL!) */
#biome-1 {
    top: 76px;
    left: 5px;
}

#biome-2 {
    top: 15px;
    left: 236px;
}

#biome-3 {
    top: 234px;
    left: 82px;
}

#biome-4 {
    top: 384px;
    left: 92px;
}

#biome-5 {
    top: 277px;
    left: 267px;
}

#biome-6 {
    top: 209px;
    left: 468px;
}

#biome-7 {
    top: 187px;
    left: 295px;
}

#biome-8 {
    top: 53px;
    left: 554px;
}

#biome-9 {
    top: 163px;
    left: 645px;
}

#biome-10 {
    top: 392px;
    left: 535px;
}


/* =========================
       HP BARS
    ========================= */

.battle-ui {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hp-container {
    position: absolute;
    font-size: 8px;
    background: rgba(0, 0, 0, 0.65);
    border: 2px solid #c9a44c;
    padding: 6px;
    border-radius: 6px;
    width: 180px;
    color: #f5e6c8;
    text-shadow: 1px 1px 2px black;
}

.hp-container.player {
    bottom: 10px;
    left: 10px;
}

.hp-container.enemy {
    top: 10px;
    right: 10px;
    text-align: right;
}

.hp-bar {
    width: 100%;
    height: 10px;
    background: #3b2a1a;
    border: 2px solid #c9a44c;
    margin: 6px 0;
}

.hp-fill {
    height: 100%;
    transition: width 0.3s;
}

#enemy-name {
    font-size: 9px;
    margin-bottom: 4px;
    color: #ffd27d;
    text-shadow: 1px 1px 2px black;
}

/* =========================
       LOG
    ========================= */

.battle-log {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    min-height: 68px;

    padding: 3px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #c9a44c;

    font-size: 8px;
}

/* =========================
       BUTTONS
    ========================= */

.battle-actions {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-30%);
    pointer-events: auto;
}

.battle-actions button {
    height: 52px;
    border-radius: 5px;
}

.battle-actions button,
.menu-screen button {
    margin: 1px;
    padding: 8px;
    background: #5a3e1b;
    color: #f5e6c8;
    border: 2px solid #c9a44c;
    cursor: pointer;
    font-family: 'Press Start 2P';
    font-size: 8px;
}

.battle-actions button:hover,
.menu-screen button:hover {
    background: #7a5425;
}

/* =========================
       DAMAGE NUMBERS
    ========================= */

.damage-number {
    position: absolute;
    color: #ff4444;
    font-size: 14px;
    pointer-events: none;
    animation: floatUp 0.8s ease-out forwards;
}

@keyframes floatUp {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(-40px);
        opacity: 0;
    }
}



/* =========================
       MENU
    ========================= */

.menu-screen {
    margin-top: 20px;
    background: #1a1208;
    padding: 15px;
    border: 3px solid #c9a44c;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.menu-screen button {
    display: block;
    margin: 8px auto;
}

.battle-loot {
    margin-top: 10px;
    color: gold;
    font-size: 10px;
}

.menu-row {
    margin: 6px 0;
}

.weapon-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.weapon-preview img {
    width: 40px;
    image-rendering: pixelated;
}

.weapon-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.weapon-option img {
    width: 32px;
    image-rendering: pixelated;
}

/* STATUS + ACTION BAR */
.menu-status,
.menu-actions {
    width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.menu-status {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border: 1px solid #ffd27d;
    margin-bottom: 10px;
    color: #ffd27d;
}

.menu-status-title {
    font-size: 0.6em;
    color: #fff;
}

.menu-actions {
    margin-bottom: 10px;
}

.menu-actions button {
    flex: 1;
    padding: 10px;
    background: #222;
    color: white;
    border: 1px solid #ffd27d;
    cursor: pointer;
    transition: 0.15s;
}

.menu-actions button:hover {
    background: #333;
    border-color: #888;
}

/* =========================
    INVENTAR
    ========================= */

.inventory-row {
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    max-width: 520px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid #c9a44c;
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: 6px;
}

.inventory-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.inventory-icon {
    width: 36px;
    image-rendering: pixelated;
    flex-shrink: 0;
}

.inventory-info {
    font-size: 8px;
    text-align: left;
}

.inventory-name {
    color: #ffd27d;
    margin-bottom: 3px;
}

.inventory-stats {
    color: #f5e6c8;
}

.inventory-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}


/* =========================
    INVENTAR GOLD
    ========================= */

.inventory-gold {
    margin: 10px auto;
    font-size: 9px;
    color: #ffd27d;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #c9a44c;
    padding: 6px 10px;
    border-radius: 6px;
    text-align: center;
    width: 100%;
    max-width: 200px;
}


/* =========================
        EQUIPMENT MENU
    ========================= */

.equipment-equipped {
    background: linear-gradient(145deg,
            rgba(90, 70, 25, 0.9),
            rgba(60, 45, 15, 0.9));
    border: 3px solid #ffd27d;
    box-shadow: 0 0 10px rgba(255, 210, 125, 0.6);
    opacity: 1;
    cursor: default;
}

/* Inhalt im Button */
.equipment-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

/* Badge „Ausgerüstet“ */
.equipped-label {
    margin-left: auto;
    padding: 4px 6px;
    background: #2b5e2b;
    color: #eaffea;
    border: 2px solid limegreen;
    border-radius: 4px;
    font-size: 7px;
}

/*=========================
 POST BATTLE BUTTON
 =========================*/

.battle-loot {
    margin-top: 12px;
}

.battle-loot button {
    padding: 10px 16px;
    font-size: 10px;
    background: #5a3e1b;
    color: #ffd27d;
    border: 2px solid #c9a44c;
    cursor: pointer;
}

.battle-loot button:hover {
    background: #7a5425;
}



/* =========================
        DISABLED INVENTAR BUTTON
    ========================= */

.disabled-button {
    background: #444;
    color: #aaa;
    border: 2px solid #666;
    cursor: not-allowed;
    opacity: 0.7;
}


.disabled-button:hover {
    background: #444;
}

/* =========================
        RARITY COLORS
    ========================= */

.rarity-common {
    color: #ccc;
}

.rarity-rare {
    color: #4fa3ff;
}

.rarity-epic {
    color: #d16bff;
}

.rarity-legendary {
    color: #ffd27d;
}


/* =========================
       ANIMATIONEN
    ========================= */

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    50% {
        transform: translateX(4px);
    }

    75% {
        transform: translateX(-3px);
    }

    100% {
        transform: translateX(0);
    }
}

.shake {
    animation: shake 0.25s ease-in-out;
}

@keyframes hitFlash {
    0% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(3);
    }

    100% {
        filter: brightness(1);
    }
}

.hit-flash {
    animation: hitFlash 0.2s ease;
}

/* =========================
       SCREEN EFFECTS
    ========================= */

.battle-wrapper::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(to bottom,
            rgba(255, 255, 255, 0.03) 0px,
            rgba(255, 255, 255, 0.03) 1px,
            transparent 1px,
            transparent 3px);
    mix-blend-mode: overlay;
}

.battle-wrapper::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at center,
            transparent 60%,
            rgba(0, 0, 0, 0.6) 100%);
}