@font-face {
    font-family: 'Cinzel';
    src: url('assets/fonts/static/Cinzel-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    appearance: textfield;
}

body {
    background:
        linear-gradient(rgba(10, 0, 0, 0.7), rgba(0, 0, 0, 0.9)),
        url("assets/img/background.png");

    background-size: cover;
    background-position: center;
    background-attachment: fixed;

    color: #FFFFFF;
    font-family: "Cinzel", sans-serif;
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

h1 {
    font-size: 56px;
    margin-top: 100px;
    letter-spacing: 3px;
    color: #ffcc00;
    text-shadow:
        0 0 10px rgba(255, 204, 0, 0.5),
        0 0 20px rgba(255, 170, 0, 0.3);
}

h2 {
    font-size: 20px;
    margin-top: 15px;
    color: #aaa;
    letter-spacing: 2px;
}

.game-wrapper {
    position: relative;
    overflow: hidden;
    width: 720px;
    height: 480px;
    border: 2px solid #ffcc00;
    border-radius: 18px;
    background: #000;
    box-shadow:
        0 0 15px rgba(255, 204, 0, 0.2),
        0 20px 50px rgba(0, 0, 0, 0.8);
}

#background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: black;
    z-index: 0;
}

canvas {
    display: block;
    background-color: transparent;
    position: relative;
    z-index: 1;
}

.dialog-box {
    position: absolute;
    display: none;
    bottom: 20px;
    left: 50%;
    transform: translate(-50%);
    background: linear-gradient(145deg, #222, #000);
    backdrop-filter: blur(8px);
    border: 2px solid #ffcc00;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 14px;
    color: #f2f2f2;
    width: min(680px, 94%);
    min-width: 300px;
    max-width: 680px;
    overflow: hidden;
    box-sizing: border-box;
    padding: 12px 18px;
    font-family: "Cinzel", sans-serif;
    font-size: 15px;
    line-height: 1.4;
    letter-spacing: 0.2px;
    white-space: normal;
    word-wrap: break-word;
    z-index: 10;
    animation: fadeIn 0.15s ease-out;
}

.dialog-box::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%);

    border-width: 10px 10px 0 10px;
    border-style: solid;
    border-color: #1f1f1f transparent transparent transparent;

    filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.4));
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -105%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -100%);
    }
}

#dialog-text {
    font-size: 16px;
    margin-top: 0;
}

#dialog-choices {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 15px;
}

#dialog-choices button {
    padding: 12px 28px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 1px;
}

#btn-ja {
    background: linear-gradient(135deg, #4CAF50, #2e7d32);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#btn-ja:hover {
    transform: translateY(-3px) scale(1.05);
    background: linear-gradient(135deg, #66bb6a, #388e3c);
}

#btn-nein {
    background: linear-gradient(135deg, #f44336, #b71c1c);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#btn-nein:hover {
    transform: translateY(-3px) scale(1.05);
    background: linear-gradient(135deg, #ef5350, #c62828);
}

#dialog-choices button:active {
    transform: scale(0.95);
}

.game-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
    z-index: 200;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgb(255 255 255 / 56%);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-controls img {
    width: 30px;
    height: 30px;
    cursor: pointer;
    opacity: 0.7;
    transition: transform 0.2s, opacity 0.2s;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8));
}

.game-controls img:hover {
    opacity: 1;
    transform: scale(1.1);
}


#game-container:fullscreen {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: black;
}

#game-container:fullscreen canvas {
    width: 100%;
    height: auto;
    max-height: 100vh;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.overlay-content {
    background: rgba(15, 15, 15, 0.98);
    padding: 10px 15px;
    border-radius: 15px;
    border: 2px solid #ffcc00;
    text-align: center;
    box-shadow:
        0 0 25px rgba(255, 204, 0, 0.2),
        inset 0 0 15px rgba(0, 0, 0, 1);
    width: 380px;
    backdrop-filter: blur(12px);
}

.control-list {
    list-style: none;
    padding: 0;
    margin: 25px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: transparent;
    border: none;
}

.control-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 17px;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 204, 0, 0.1);
    padding-bottom: 8px;
}

.key {
    background: linear-gradient(135deg, #444, #111);
    border: 1px solid #ffcc00;
    border-radius: 5px;
    padding: 5px 12px;
    color: #ffcc00;
    font-weight: bold;
    box-shadow: 0 3px 0 #856a00;
    font-family: "Cinzel", sans-serif;
    min-width: 30px;
    text-align: center;
}

#close-info {
    background: #ffcc00;
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: "Cinzel", sans-serif;
    font-weight: bold;
}

#close-info:hover {
    background: #ffe066;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.6);
}


#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);

    z-index: 2;
}

.start-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 40px 60px;
    border-radius: 20px;
    border: 1px solid rgba(255, 204, 0, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 40px rgba(255, 204, 0, 0.15);
}

#start-btn {
    padding: 15px 40px;
    font-size: 26px;
    background: linear-gradient(135deg, #8b0000, #b30000);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: "Cinzel", sans-serif;
    transition: all 0.2s ease;
}

#start-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #ff0000, #cc0000);
}

.menu-btn {
    padding: 12px 40px;
    font-size: 22px;
    font-family: "Cinzel", sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffcc00, #cc9900);
    color: #000;
    border: 2px solid #ffe680;
    border-radius: 8px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.menu-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #ffe066, #ffcc00);
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.4);
    border-color: #ffffff;
}

.menu-btn:active {
    transform: scale(0.98);
}

#pause-screen {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 150;
}

.pause-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(145deg, rgba(30, 30, 30, 0.95), rgba(10, 10, 10, 0.98));
    padding: 40px 25px;
    border-radius: 20px;
    border: 2px solid #ffcc00;
    box-shadow:
        0 0 30px rgba(255, 204, 0, 0.2),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    animation: pausePopIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pause-title {
    font-size: 42px;
    color: #ffcc00;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.6);
    letter-spacing: 4px;
    text-transform: uppercase;
}

.pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

@keyframes pausePopIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.pause-buttons .menu-btn {
    min-width: 250px;
}

.inventory {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(145deg, rgba(25, 25, 25, 0.98), rgba(5, 5, 5, 1));
    color: #ffcc00;
    padding: 30px;
    border-radius: 20px;
    border: 3px solid #ffcc00;
    min-width: 320px;
    z-index: 999;
    box-shadow:
        0 0 40px rgba(0, 0, 0, 0.9),
        0 0 15px rgba(255, 204, 0, 0.2),
        inset 0 0 15px rgba(255, 204, 0, 0.1);
    backdrop-filter: blur(10px);
    text-align: center;
}

.close-btn-inv {
    position: absolute;
    top: 10px;
    right: 15px;
    font-family: 'Arial', sans-serif;
    font-size: 24px;
    font-weight: bold;
    color: #ffcc00;
    cursor: pointer;
    text-shadow: 2px 2px 4px #000;

}

.close-btn-inv:hover {
    color: #ffffff;
    transform: scale(1.2);
}

.inventory h3 {
    font-size: 28px;
    margin-top: 0;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 3px;
    border-bottom: 2px solid rgba(255, 204, 0, 0.3);
    padding-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

#inventory-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    justify-items: center;
}

.inventory-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 204, 0, 0.2);
    border-radius: 12px;
    padding: 10px;
    transition: all 0.2s ease;
    width: 80px;
}

.inventory-item:hover {
    background: rgba(255, 204, 0, 0.15);
    border-color: #ffcc00;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
}

.inventory-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

.inventory-item span {
    font-size: 10px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

#map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    cursor: pointer;
}

#map-overlay img {
    max-width: 80%;
    max-height: 80%;
    border: 3px solid #ffcc00;
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.4);
}

.hidden {
    display: none !important;
}

.d-none {
    display: none !important;
}

.boss-health-container {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.boss-info {
    margin-bottom: 8px;
}

#boss-name {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    color: #ffcc00;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.6), 2px 2px 4px rgba(0, 0, 0, 0.9);
}

.health-bar-border {
    width: 100%;
    height: 16px;
    background: rgba(20, 0, 0, 0.8);
    border: 2px solid #ffcc00;
    /* Goldener Rand wie im restlichen Design */
    border-radius: 4px;
    box-shadow:
        0 0 15px rgba(0, 0, 0, 0.8),
        0 0 5px rgba(255, 204, 0, 0.2);
    overflow: hidden;
    position: relative;
}

.health-bar-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #4a0000 0%, #b30000 50%, #ff0000 100%);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    transition: width 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.low-health {
    animation: pulseRed 1s infinite;
}

@keyframes pulseRed {
    0% {
        box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
    }

    100% {
        box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
    }
}

#victory-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    font-family: 'Arial', sans-serif;
    backdrop-filter: blur(5px);
}

.victory-content {
    text-align: center;
    color: #ffd700;
    animation: fadeIn 1s ease-in-out;
}

.victory-content h1 {
    font-size: 48px;
    text-shadow: 2px 2px 10px rgba(255, 215, 0, 0.5);
    margin-bottom: 20px;
}

.victory-content img {
    width: 250px;
    height: auto;
    display: flex;
    justify-content: center;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
    margin-bottom: 30px;
    animation: pulse 2s infinite;
}

.victory-content button {
    padding: 15px 30px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    background: linear-gradient(45deg, #ffd700, #ffae00);
    border: none;
    border-radius: 50px;
    color: #332200;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.victory-content button:hover {
    background: linear-gradient(45deg, #ffae00, #ffd700);
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
    color: #000;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

#player-lives {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 8px;
    z-index: 100;
    align-items: center;
}

#player-lives img {
    width: 45px;
    height: 45px;
    image-rendering: crisp-edges;
}

/* Game Over Overlay */
#game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    background: radial-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.75));
    backdrop-filter: blur(4px);
}

.game-over-content {
    width: min(760px, 92%);
    background: linear-gradient(180deg, #fff9e6 0%, #ffe599 60%, #ffd17a 100%);
    border: 6px solid rgba(184, 134, 11, 0.95);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
    padding: 34px;
    color: #241f10;
    text-align: center;
    font-family: "'Segoe UI', Roboto, helvetica, Arial, sans-serif";
}

.game-over-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.game-over-crown {
    font-size: 34px;
    color: #b8860b;
    text-shadow: 0 2px 0 rgba(255, 255, 255, 0.6);
}

.game-over-content h1 {
    margin: 0;
    font-size: 44px;
    font-weight: 700;
    letter-spacing: 1px;
}

#game-over-msg {
    margin: 12px 0 22px 0;
    font-size: 18px;
    line-height: 1.5;
    color: #241f10;
}

.game-over-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

#game-over .menu-btn {
    min-width: 150px;
}

#game-over:not(.d-none) {
    display: flex;
}

.skip-hint {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 10px;
    color: #ffcc00;
    opacity: 0.7;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.3;
    }
}

.stamina-container {
    display: block;
    position: absolute;
    top: 60px;
    left: 15px;
    width: 230px;
    height: 12px;
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px solid #ffffff;
    z-index: 999;
    pointer-events: none;
}

.stamina-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    transition: width 0.2s ease-out;
}

.game-modal {
    display: none;
    position: absolute;
    top: 0;
    justify-content: center;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    justify-content: center;
    align-items: center;
    font-family: 'Arial', sans-serif;
}

.modal-content {
    background: #2c1a10;
    border: 4px solid #d4af37;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    color: #f0e68c;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    min-width: 300px;
    max-width: 90%;
}

.modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.decorator {
    color: #d4af37;
    font-size: 24px;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    margin-top: 20px;
}

#puzzle-input {
    background: #1a0f0a;
    border: 2px solid #d4af37;
    padding: 10px;
    color: white;
    font-size: 20px;
    text-align: center;
    width: 80px;
    border-radius: 5px;
    outline: none;
}

.input-wrapper button {
    background: #d4af37;
    color: #2c1a10;
    border: none;
    padding: 10px 25px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    transition: transform 0.1s, background 0.2s;
}

.input-wrapper button:hover {
    background: #f0e68c;
    transform: scale(1.05);
}

.input-wrapper button:active {
    transform: scale(0.95);
}

#puzzle-feedback {
    margin-top: 15px;
    min-height: 20px;
    font-weight: bold;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #d4af37;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

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

.modal-content {
    position: relative;
    background: #2c1a10;
    border: 4px solid #d4af37;
    padding: 40px 30px 30px 30px;
    border-radius: 15px;
    text-align: center;
    color: #f0e68c;
    min-width: 320px;
}

.note-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.note-paper {
    background-color: #f4e4bc;
    padding: 40px;
    width: 300px;
    min-height: 200px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.5);
    transform: rotate(-2deg);
    border: 1px solid #d2b48c;
    font-family: 'Courier New', Courier, monospace;
    text-align: center;
    position: relative;
}

#note-text{
    color: #000;
}

.close-hint {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    color: #111;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.4);
}