/* OGÓLNE STYLE */
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: Arial, sans-serif;
    background-color: #333;
}

#game-container {
    position: relative;
    width: 800px;
    height: 600px;
    margin: 20px auto;
    background-color: #87CEEB;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* STYLE DLA ELEMENTÓW GRY */
#player {
    position: absolute;
    width: 40px;
    height: 60px;
    background-image: url('images/hero.svg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 10;
}

.platform {
    position: absolute;
    background-color: #8B4513;
    border-radius: 5px;
}

.strawberry {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #FF0000;
    border-radius: 50%;
    z-index: 5;
}

.strawberry:before {
    content: '';
    position: absolute;
    top: -5px;
    left: 8px;
    width: 5px;
    height: 8px;
    background-color: #00CC00;
    border-radius: 2px;
}

.enemy {
    position: absolute;
    width: 40px;
    height: 40px;
    z-index: 8;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.enemy-info {
    position: absolute;
    width: 80px;
    left: -20px;
    top: -30px;
    text-align: center;
    font-size: 10px;
    color: white;
    text-shadow: 1px 1px 1px #000;
    z-index: 9;
}

.enemy-name {
    margin-bottom: 2px;
    font-weight: bold;
}

.enemy-health-bar {
    height: 4px;
    background-color: #555;
    border-radius: 2px;
}

.enemy-health-fill {
    height: 100%;
    background-color: #2ecc71;
    border-radius: 2px;
    transition: width 0.2s;
}

/* Styl dla przedmiotu broni do podniesienia */
#weapon-pickup {
    position: absolute;
    width: 30px; /* Rozmiar ikony broni */
    height: 30px;
    background-image: url('images/golden_sword.svg'); /* Obrazek miecza */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 9;
    cursor: pointer; /* Wskaźnik myszy */
}

.weapon {
    position: absolute;
    width: 20px; /* Szerokość miecza */
    height: 40px; /* Wysokość miecza */
    background-image: url('images/golden_sword.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 9;
    display: none;
    /* Ustawienie punktu obrotu na górną część rękojeści */
    transform-origin: center 5px; /* Dostosuj Y, aby pasowało do obrazka miecza */
}

/* Animacja zamachu poziomego dla gracza skierowanego w prawo */
@keyframes sword-swing-horizontal-right {
    0% {
        transform: rotate(-180deg); /* Pozycja początkowa */
    }
    100% {
        transform: rotate(0deg); /* Pozycja końcowa - pełny zamach poziomy */
    }
}

/* Animacja zamachu poziomego dla gracza skierowanego w lewo */
@keyframes sword-swing-horizontal-left {
    0% {
        transform: rotate(180deg); /* Pozycja początkowa */
    }
    100% {
        transform: rotate(0deg); /* Pozycja końcowa - pełny zamach poziomy w lewo */
    }
}

/* Klasy dodawane dynamicznie do uruchomienia animacji */
.weapon-swing-right {
    /* Zwiększony czas trwania animacji */
    animation: sword-swing-horizontal-right 0.5s ease-out forwards;
}

.weapon-swing-left {
    /* Zwiększony czas trwania animacji */
    animation: sword-swing-horizontal-left 0.5s ease-out forwards;
}

/* STYLE DLA UI */
#score {
    position: absolute;
    top: 10px;
    left: 10px;
    color: white;
    font-size: 24px;
    z-index: 20;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#health {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    font-size: 24px;
    z-index: 20;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#level-indicator {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 24px;
    z-index: 20;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.weapon-info {
    position: absolute;
    bottom: 10px;
    left: 10px;
    color: white;
    font-size: 18px;
    z-index: 20;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    display: none;
}

.weapon-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: #FFD700;
    margin: 0 5px;
    vertical-align: middle;
    border-radius: 2px;
}

/* STYLE DLA MENU I CUTSCEN */
#main-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 101;
}

.menu-title {
    color: #FF5733;
    font-size: 48px;
    margin-bottom: 40px;
    text-shadow: 2px 2px 8px rgba(255, 87, 51, 0.8);
}

.menu-button {
    padding: 15px 30px;
    margin: 10px;
    background-color: #FF5733;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 22px;
    width: 250px;
    text-align: center;
}

.menu-button:hover {
    background-color: #FF8C00;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

.difficulty-text {
    color: white;
    font-size: 22px;
    margin: 15px 0 10px 0;
}

#cutscene, #level-transition {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #000;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.cutscene-image {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    border-radius: 50%;
    background-color: #FF5733;
}

.cutscene-text {
    font-size: 24px;
    margin: 10px;
    text-align: center;
    max-width: 80%;
    line-height: 1.4;
}

#skip-button, .action-button {
    padding: 10px 20px;
    background-color: #FF5733;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
    font-size: 18px;
}

#skip-button:hover, .action-button:hover {
    background-color: #FF8C00;
}

#win-message, #game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 36px;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    display: none;
    z-index: 100;
}

#cutscene-container, #level-transition-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.cutscene-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.cutscene-page:not(:first-child) {
    display: none;
}

/* TŁA POZIOMÓW */
.level-1 {
    background-color: #87CEEB;
    background-image: linear-gradient(to bottom, #87CEEB, #5D8AA8);
}

.level-2 {
    background-color: #5D8AA8;
    background-image: linear-gradient(to bottom, #5D8AA8, #2C3E50);
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><path d="M0 50 Q 25 0, 50 50 T 100 50" stroke="%234B6584" fill="none" stroke-width="2" opacity="0.5" /></svg>'), linear-gradient(to bottom, #5D8AA8, #2C3E50);
    background-size: 100px 100px, 100%;
}

.level-3 {
    background-color: #444654;
    background-image: linear-gradient(to bottom, #444654, #1e1e2a);
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect x="20" y="70" width="10" height="30" fill="%23333" /><rect x="70" y="60" width="15" height="40" fill="%23333" /></svg>'), linear-gradient(to bottom, #444654, #1e1e2a);
    background-size: 150px 150px, 100%;
}

/* EFEKTY MAGICZNE */
.magic-spell {
    position: absolute;
    width: 15px;
    height: 15px;
    background-color: #00e1ff;
    border-radius: 50%;
    z-index: 7;
    box-shadow: 0 0 10px 3px #00e1ff;
    opacity: 0.8;
    transform: translateX(-50%) translateY(-50%);
}

.slowdown-effect {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid #00e1ff;
    border-radius: 5px;
    box-shadow: 0 0 8px #00e1ff inset;
    opacity: 0.6;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

/* ELEMENTY ŚRODOWISKA */
.cloud {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    opacity: 0.8;
}

/* KONSOLA DEWELOPERSKA */
.developer-console {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 300px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #00ff00;
    padding: 15px;
    font-family: monospace;
    border-radius: 5px;
    z-index: 1001;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.developer-console h3 {
    margin-top: 0;
    color: #ff5733;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

.dev-section {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.dev-section label {
    display: block;
    margin: 5px 0;
}

.dev-section input {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 5px;
    width: 60px;
    margin-left: 10px;
}

.dev-section button {
    background-color: #ff5733;
    color: white;
    border: none;
    padding: 5px 10px;
    margin: 5px 5px 5px 0;
    cursor: pointer;
    border-radius: 3px;
}

.dev-section button:hover {
    background-color: #ff8c00;
}

.toggle-dev-console {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #ff5733;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    z-index: 1002;
    border-radius: 3px;
    font-size: 12px;
}

/* EFEKTY CZĄSTECZKOWE */
.hit-particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background-color: white;
    border-radius: 50%;
    z-index: 15;
    pointer-events: none; /* Cząsteczki nie powinny blokować interakcji */
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}
