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

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

@font-face {
    font-family: 'Crimson Text';
    src: url('fonts/CrimsonText-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Crimson Text';
    src: url('fonts/CrimsonText-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Crimson Text';
    src: url('fonts/CrimsonText-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

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

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1a0f0a;
    background-image:
        radial-gradient(ellipse at top, #2a1a10 0%, transparent 70%),
        radial-gradient(ellipse at bottom, #0d0805 0%, transparent 70%);
    color: #e8d5b5;
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 18px;
    line-height: 1.6;
}

#game-container {
    width: 100%;
    max-width: 700px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#game-title {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    text-align: center;
    letter-spacing: 4px;
    background: linear-gradient(180deg, #f0d980 0%, #c9a84c 50%, #8a6520 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 12px rgba(201, 168, 76, 0.4));
}

#version-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

#version {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    text-align: center;
    color: #8a6a3a;
    letter-spacing: 2px;
}

#changelog-btn,
#feedback-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    color: #8a6a3a;
    background: none;
    border: 1px solid #5a3a1a;
    border-radius: 4px;
    padding: 2px 10px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

#changelog-btn:hover,
#feedback-btn:hover {
    color: #c9a84c;
    border-color: #c9a84c;
}

/* Changelog Overlay */
#changelog-overlay {
    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;
}

#changelog-overlay.hidden {
    display: none;
}

#changelog-panel {
    background: linear-gradient(135deg, #2a1a10, #1a0f0a);
    border: 2px solid #5a3a1a;
    border-radius: 12px;
    padding: 20px;
    width: 750px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

#changelog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: #c9a84c;
    letter-spacing: 2px;
}

#changelog-close {
    background: none;
    border: none;
    color: #c9a84c;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 6px;
}

#changelog-close:hover {
    color: #e8d5b5;
}

#changelog-content {
    overflow-y: auto;
    overscroll-behavior: contain;
    font-size: 0.9rem;
    color: #e8d5b5;
    line-height: 1.5;
    white-space: pre-line;
    font-family: 'Crimson Text', serif;
}

#changelog-content h3 {
    font-family: 'Cinzel', serif;
    color: #c9a84c;
    font-size: 1rem;
    margin-top: 12px;
    margin-bottom: 4px;
}

#changelog-content ul {
    padding-left: 20px;
    margin-bottom: 8px;
}

/* Feedback Overlay */
#feedback-overlay {
    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;
}

#feedback-overlay.hidden {
    display: none;
}

#feedback-form-view.hidden,
.feedback-status-view.hidden {
    display: none;
}

#feedback-panel {
    background: linear-gradient(135deg, #2a1a10, #1a0f0a);
    border: 2px solid #5a3a1a;
    border-radius: 12px;
    padding: 20px;
    width: 500px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: #c9a84c;
    letter-spacing: 2px;
}

#feedback-close {
    background: none;
    border: none;
    color: #c9a84c;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 6px;
}

#feedback-close:hover {
    color: #e8d5b5;
}

.feedback-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.feedback-label {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    color: #c9a84c;
    text-transform: uppercase;
}

.feedback-optional {
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    color: #5a3a1a;
    text-transform: none;
    letter-spacing: 0;
}

.feedback-input {
    background: rgba(0,0,0,0.35);
    border: 1px solid #3a2515;
    border-radius: 6px;
    color: #e8d5b5;
    font-family: 'Palatino Linotype', Palatino, serif;
    font-size: 0.95rem;
    padding: 10px 12px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.feedback-input:focus {
    border-color: #c9a84c;
}

.feedback-input.feedback-error {
    border-color: #8a2020;
    box-shadow: 0 0 6px rgba(138,32,32,0.4);
}

select.feedback-input option {
    background: #1e1208;
    color: #e8d5b5;
}

.feedback-textarea {
    resize: vertical;
    min-height: 110px;
}

#feedback-submit {
    align-self: flex-end;
    background: linear-gradient(180deg, #5a3a1a, #3a2010);
    border: 1px solid #c9a84c;
    border-radius: 6px;
    color: #c9a84c;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    letter-spacing: 1.5px;
    padding: 10px 28px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background 0.2s, color 0.2s;
    margin-top: 4px;
}

#feedback-submit:hover {
    background: linear-gradient(180deg, #7a5a2a, #5a3a1a);
    color: #e8d5b5;
}

.feedback-status-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 14px;
}

.feedback-status-icon {
    font-size: 3rem;
    line-height: 1;
}

.feedback-success-icon {
    color: #4a8a4a;
}

.feedback-error-icon {
    color: #8a2020;
}

.feedback-status-text {
    font-family: 'Palatino Linotype', Palatino, serif;
    font-size: 1rem;
    color: #8a6a3a;
    text-align: center;
}

#feedback-retry {
    background: linear-gradient(180deg, #5a3a1a, #3a2010);
    border: 1px solid #c9a84c;
    border-radius: 6px;
    color: #c9a84c;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    padding: 8px 20px;
    cursor: pointer;
    text-transform: uppercase;
    margin-top: 8px;
}

/* HUD */
#hud {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #2a1a10, #1a0f0a);
    border: 1px solid #5a3a1a;
    border-radius: 8px;
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
}

.hud-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.hud-label {
    font-size: 0.65rem;
    color: #c9a84c;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hud-value {
    font-size: 1rem;
    color: #c9a84c;
    font-weight: 700;
}

/* Story Panel */
#story-panel {
    background: linear-gradient(180deg, rgba(42, 26, 16, 0.8), rgba(26, 15, 10, 0.9));
    border: 1px solid #3a2515;
    border-radius: 10px;
    padding: 30px;
    min-height: 200px;
}

#story-response {
    color: #c9a84c;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 16px;
    font-style: italic;
}

#story-response:empty {
    display: none;
}

#story-text {
    white-space: pre-line;
    color: #e8d5b5;
}

/* NPC Dialogue Box (Variante C) */
.npc-dialogue-box {
    margin: 14px 0 0;
    padding: 12px 16px;
    background: rgba(201,168,76,0.04);
    border: 1px solid #3a2515;
    border-left: 3px solid #8a6520;
    border-radius: 0 4px 4px 0;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.npc-dialogue-portrait {
    width: 88px;  /*44px */
    height: 88px; /*44px */
    border-radius: 50%;
    background: linear-gradient(135deg, #2a1a0d 0%, #3a2515 100%);
    border: 2px solid #5a3a1a;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(201,168,76,0.1);
}

.npc-dialogue-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.npc-dialogue-content {
    flex: 1;
    min-width: 0;
}

.npc-dialogue-name {
    font-family: 'Cinzel', serif;
    font-size: 0.62rem;
    letter-spacing: 2px;
    color: #c9a84c;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.npc-dialogue-text {
    font-style: italic;
    font-size: 0.97rem;
    color: #c8b888;
    line-height: 1.65;
}

/* Options */
#options-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#options-panel button {
    padding: 14px 24px;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: #e8d5b5;
    background: linear-gradient(135deg, #3a2515, #2a1a10);
    border: 1px solid #5a3a1a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 1px;
}

#options-panel button:hover {
    background: linear-gradient(135deg, #5a3a1a, #3a2515);
    border-color: #c9a84c;
    color: #c9a84c;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(201, 168, 76, 0.2);
}

#options-panel button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(60%);
    transform: none !important;
    box-shadow: none !important;
}

#options-panel button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
    transform: none;
    box-shadow: none;
}

#options-panel button.disabled:hover {
    background: linear-gradient(135deg, #3a2515, #2a1a10);
    border-color: #5a3a1a;
    color: #e8d5b5;
    transform: none;
    box-shadow: none;
}

/* HUD Inventory Button */
#hud-inventory-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: #c9a84c;
    background: linear-gradient(135deg, #3a2515, #2a1a10);
    border: 1px solid #5a3a1a;
    border-radius: 6px;
    padding: 4px 12px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

#hud-inventory-btn:hover {
    background: linear-gradient(135deg, #5a3a1a, #3a2515);
    border-color: #c9a84c;
}

/* HUD Journal Button */
#hud-journal-btn {
    background: linear-gradient(135deg, #3a2515, #2a1a10);
    border: 1px solid #5a3a1a;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#hud-journal-btn img {
    display: block;
    filter: brightness(0.85) sepia(0.3);
    transition: filter 0.2s ease;
}

#hud-journal-btn:hover {
    background: linear-gradient(135deg, #5a3a1a, #3a2515);
    border-color: #c9a84c;
}

#hud-journal-btn:hover img {
    filter: brightness(1) sepia(0.1);
}

/* ===== Journal Overlay ===== */
#journal-overlay {
    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: 200;
}

#journal-overlay.hidden {
    display: none;
}

#journal-panel {
    background: #1e1208;
    border: 2px solid #5a3a1a;
    border-radius: 12px;
    width: 1360px;
    max-width: 95vw;
    max-height: 80vh;
    box-shadow: 0 0 50px rgba(0,0,0,0.9), inset 0 1px 0 rgba(201,168,76,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#journal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: linear-gradient(180deg, #251508 0%, #1e1208 100%);
    border-bottom: 1px solid #3a2515;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 3px;
    background-clip: text;
}

#journal-header span {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 3px;
    background: linear-gradient(180deg, #f0d980 0%, #c9a84c 60%, #8a6520 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#journal-close {
    background: none;
    border: none;
    color: #5a3a1a;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 6px;
    line-height: 1;
    -webkit-text-fill-color: #5a3a1a;
}

#journal-close:hover {
    color: #c9a84c;
    -webkit-text-fill-color: #c9a84c;
}

/* Journal Tabs */
.journal-tab-bar {
    display: flex;
    border-bottom: 1px solid #3a2515;
    background: rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.journal-tab {
    flex: 1;
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: #5a3a1a;
    text-transform: uppercase;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 11px 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.journal-tab.active {
    color: #c9a84c;
    border-bottom-color: #c9a84c;
    background: rgba(201,168,76,0.05);
}

.journal-tab:hover:not(.active) {
    color: #8a6a3a;
}

/* Journal Content Area */
#journal-content {
    padding: 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #3a2515 transparent;
}

/* ---- Tab 1: Geschichte ---- */
.journal-entry {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #2a1a0d;
}

.journal-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.entry-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    width: 52px;
}

.entry-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2a1a0d, #3a2515);
    border: 1px solid #5a3a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.entry-chapter {
    font-family: 'Cinzel', serif;
    font-size: 0.42rem;
    letter-spacing: 1px;
    color: #5a3a1a;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.3;
}

.entry-line {
    width: 1px;
    flex: 1;
    background: #2a1a0d;
    min-height: 20px;
}

.entry-body {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.entry-heading {
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    letter-spacing: 2px;
    color: #c9a84c;
    text-transform: uppercase;
    margin-bottom: 7px;
}

.entry-text {
    font-style: italic;
    font-size: 0.97rem;
    color: #c8b888;
    line-height: 1.7;
}

.journal-empty {
    font-style: italic;
    color: #5a3a1a;
    font-size: 0.9rem;
    text-align: center;
    padding: 20px 0;
}

/* ---- Tab 2: Charaktere ---- */
.journal-npc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.journal-npc-card {
    background: rgba(0,0,0,0.25);
    border: 1px solid #3a2515;
    border-radius: 6px;
    padding: 21px;
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.journal-npc-card.undiscovered {
    opacity: 0.35;
    filter: grayscale(1);
}

.journal-npc-portrait {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2a1a0d, #3a2515);
    border: 2px solid #5a3a1a;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.journal-npc-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.journal-npc-info {
    flex: 1;
    min-width: 0;
}

.journal-npc-tag {
    display: inline-block;
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    letter-spacing: 1px;
    border-radius: 2px;
    padding: 2px 9px;
    text-transform: uppercase;
    margin-bottom: 9px;
    border: 1px solid #3a2515;
    color: #5a3a1a;
}

.journal-npc-tag.trader {
    color: #8a6520;
    border-color: #5a3a1a;
}

.journal-npc-tag.story {
    color: #4a6a8a;
    border-color: #2a4a6a;
}

.journal-npc-name {
    font-family: 'Cinzel', serif;
    font-size: 0.98rem;
    letter-spacing: 1.5px;
    color: #c9a84c;
    text-transform: uppercase;
    margin-bottom: 8px;
    line-height: 1.3;
}

.journal-npc-desc {
    font-size: 1.28rem;
    color: #8a6a3a;
    line-height: 1.5;
}

.journal-undiscovered-label {
    font-family: 'Cinzel', serif;
    font-size: 0.83rem;
    letter-spacing: 1px;
    color: #3a2515;
    text-transform: uppercase;
    font-style: italic;
}

/* Inventory Overlay */
#inventory-overlay {
    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: 200;
}

#inventory-overlay.hidden {
    display: none;
}

#inventory-panel {
    background: linear-gradient(135deg, #2a1a10, #1a0f0a);
    border: 2px solid #5a3a1a;
    overscroll-behavior: contain;
    border-radius: 12px;
    padding: 0;
    width: 900px;
    max-width: 95vw;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: #c9a84c;
    letter-spacing: 2px;
    border-bottom: 1px solid #3a2515;
    flex-shrink: 0;
}

#inventory-close {
    background: none;
    border: none;
    color: #c9a84c;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 6px;
}

#inventory-close:hover {
    color: #e8d5b5;
}

#inventory-body {
    display: grid;
    grid-template-columns: 290px 1fr;
    min-height: 420px;
    overflow: hidden;
    flex: 1;
}

#equip-chart {
    border-right: 1px solid #3a2515;
    padding: 20px 16px;
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.inv-panel-label {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    color: #c9a84c;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
    opacity: 0.8;
    align-self: flex-start;
}

#equip-grid {
    display: grid;
    grid-template-columns: repeat(3, 80px);
    grid-template-rows: repeat(4, 80px);
    gap: 10px;
}

.equip-slot {
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed #3a2515;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: default;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.equip-slot.empty-cell {
    visibility: hidden;
    pointer-events: none;
}

.equip-slot.has-item {
    border-style: solid;
    border-color: #5a3a1a;
    cursor: pointer;
}

.equip-slot.has-item:hover {
    border-color: #c9a84c;
    box-shadow: 0 0 10px rgba(201, 168, 76, 0.35);
}

.equip-slot.drag-over-ok {
    border-color: #4caf50;
    box-shadow: 0 0 14px rgba(76, 175, 80, 0.5);
    background: rgba(76, 175, 80, 0.1);
}

.equip-slot.drag-over-fail {
    border-color: #f44336;
    box-shadow: 0 0 14px rgba(244, 67, 54, 0.5);
    background: rgba(244, 67, 54, 0.1);
}

.equip-slot img {
    width: 46px;
    height: 46px;
    pointer-events: none;
}

.equip-slot .slot-placeholder {
    font-size: 1.6rem;
    opacity: 0.25;
    pointer-events: none;
}

.equip-slot .slot-label {
    position: absolute;
    bottom: 3px;
    font-size: 0.48rem;
    color: #c9a84c;
    opacity: 0.55;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Cinzel', serif;
    pointer-events: none;
}

#inv-bag {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#bag-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 7px;
}

.bag-slot {
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid #3a2515;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: default;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.bag-slot.has-item {
    cursor: grab;
    border-color: #5a3a1a;
}

.bag-slot.has-item:hover {
    border-color: #c9a84c;
    box-shadow: 0 0 8px rgba(201, 168, 76, 0.3);
}

.bag-slot.is-dragging {
    opacity: 0.4;
}

.bag-slot.drag-over-bag {
    border-color: #c9a84c;
    box-shadow: 0 0 10px rgba(201, 168, 76, 0.4);
    background: rgba(201, 168, 76, 0.08);
}

.bag-slot img {
    width: 72%;
    height: 72%;
    pointer-events: none;
}

.bag-slot .equip-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #c9a84c;
    color: #1a0f0a;
    font-family: 'Cinzel', serif;
    font-size: 0.5rem;
    font-weight: 700;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bag-slot.equipped {
    border-color: #c9a84c;
    box-shadow: 0 0 6px rgba(201, 168, 76, 0.4);
}

.bag-slot.rarity-uncommon { border-color: #2a8a2a; }
.bag-slot.rarity-rare     { border-color: #4466cc; }
.bag-slot.rarity-legendary { border-color: #cc44cc; }
.bag-slot.rarity-epic     { border-color: #aa44cc; }

.bag-slot.consumable-click {
    cursor: pointer;
}

.inv-bag-hint {
    font-size: 0.68rem;
    color: #7a6050;
    font-style: italic;
    text-align: center;
    margin-top: 12px;
    font-family: 'Crimson Text', serif;
}

@keyframes invBtnFlashAdd {
    0%   { box-shadow: 0 0 0px rgba(201, 168, 76, 0); border-color: #5a3a1a; color: #e8d5b5; }
    40%  { box-shadow: 0 0 18px rgba(201, 168, 76, 0.9); border-color: #c9a84c; color: #c9a84c; }
    100% { box-shadow: 0 0 0px rgba(201, 168, 76, 0); border-color: #5a3a1a; color: #e8d5b5; }
}

@keyframes invBtnFlashRemove {
    0%   { box-shadow: 0 0 0px rgba(180, 50, 50, 0); border-color: #5a3a1a; color: #e8d5b5; }
    40%  { box-shadow: 0 0 18px rgba(180, 50, 50, 0.9); border-color: #b43232; color: #b43232; }
    100% { box-shadow: 0 0 0px rgba(180, 50, 50, 0); border-color: #5a3a1a; color: #e8d5b5; }
}

#hud-inventory-btn.flash-add {
    animation: invBtnFlashAdd 0.6s ease-out forwards;
}

#hud-inventory-btn.flash-remove {
    animation: invBtnFlashRemove 0.6s ease-out forwards;
}


/* Item Tooltip */
.inv-tooltip {
    position: fixed;
    background: #1a0f0a;
    border: 2px solid #5a3a1a;
    border-radius: 6px;
    padding: 10px 14px;
    min-width: 160px;
    max-width: 250px;
    z-index: 300;
    pointer-events: none;
    font-size: 0.85rem;
    color: #e8d5b5;
    font-family: 'Crimson Text', serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.inv-tooltip .tt-name {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: #c9a84c;
    margin-bottom: 4px;
}

.inv-tooltip .tt-stats {
    font-size: 0.8rem;
    color: #c8b078;
    line-height: 1.4;
}

#touch-tooltip {
    font-size: 1rem;
    padding: 12px 18px;
    min-width: 180px;
    border-color: #c9a84c;
    z-index: 9999;
    pointer-events: none;
}

#touch-tooltip .tt-name {
    font-size: 1.05rem;
}

#touch-tooltip .tt-stats {
    font-size: 0.9rem;
}

.tt-touch-hint {
    margin-top: 6px;
    font-size: 0.75rem;
    color: #c9a84c;
    opacity: 0.7;
    font-style: italic;
}

/* ===== Consume Confirmation ===== */
#consume-confirm {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

#consume-confirm-panel {
    background: linear-gradient(135deg, #2a1a10, #1a0f0a);
    border: 2px solid #5a3a1a;
    border-radius: 10px;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
}

.consume-confirm-icon {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.consume-confirm-name {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: #c9a84c;
    letter-spacing: 1px;
    text-align: center;
}

.consume-confirm-info {
    font-family: 'Crimson Text', serif;
    font-size: 0.95rem;
    color: #aa8040;
    text-align: center;
}

.consume-confirm-btns {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.consume-confirm-yes {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: #1a0f0a;
    background: linear-gradient(135deg, #c9a84c, #a07830);
    border: 1px solid #c9a84c;
    border-radius: 6px;
    padding: 9px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.consume-confirm-yes:hover {
    background: linear-gradient(135deg, #f0d980, #c9a84c);
}

.consume-confirm-no {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: #8a6a3a;
    background: none;
    border: 1px solid #5a3a1a;
    border-radius: 6px;
    padding: 9px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.consume-confirm-no:hover {
    color: #c9a84c;
    border-color: #c9a84c;
}

/* ===== Shop Overlay ===== */
#shop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 16px;
}

#shop-panel {
    width: 100%;
    max-width: 680px;
    background: #1e1208;
    border: 2px solid #5a3a1a;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0,0,0,0.9), inset 0 1px 0 rgba(201,168,76,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

/* Header */
#shop-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #3a2515;
    background: linear-gradient(180deg, #251508 0%, #1e1208 100%);
}

#trader-portrait {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 2px solid #5a3a1a;
    background: #2a1a0d;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 16px rgba(201,168,76,0.12);
    overflow: hidden;
}

.portrait-placeholder {
    font-size: 2.6rem;
    line-height: 1;
}

.portrait-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

#trader-name {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 3px;
    background: linear-gradient(180deg, #f0d980 0%, #c9a84c 50%, #8a6520 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(201,168,76,0.3));
}

#trader-tagline {
    font-style: italic;
    font-size: 0.9rem;
    color: #aa8040;
}

/* Body: 2-Spalten-Layout */
#shop-body {
    display: grid;
    grid-template-columns: 200px 1fr;
    flex: 1;
    overflow: hidden;
}

/* Linke Spalte: Dienstleistungen */
#shop-services {
    border-right: 1px solid #3a2515;
    padding: 16px 14px;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0,0,0,0.15);
    overflow-y: auto;
}

.shop-section-label {
    font-family: 'Cinzel', serif;
    font-size: 0.58rem;
    letter-spacing: 2px;
    color: #8a6a3a;
    text-transform: uppercase;
    margin-bottom: 2px;
}

#shop-message {
    font-size: 0.85rem;
    font-style: italic;
    color: #c9a84c;
    min-height: 1.2em;
    line-height: 1.3;
}

.service-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #c9a84c;
    background: rgba(201,168,76,0.05);
    border: 1px solid #5a3a1a;
    border-radius: 4px;
    padding: 9px 12px;
    cursor: pointer;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: all 0.2s ease;
}

.service-btn:hover:not(:disabled) {
    background: rgba(201,168,76,0.12);
    border-color: #c9a84c;
    color: #f0d980;
}

.service-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

.svc-label {
    font-size: 0.75rem;
}

.svc-cost {
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.78rem;
    color: #aa8040;
    font-weight: 600;
}

.service-btn:hover:not(:disabled) .svc-cost {
    color: #c9a84c;
}

.shop-back {
    margin-top: auto;
    padding-top: 8px;
}

.shop-back-btn {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: #8a6a3a;
    background: none;
    border: 1px solid #5a3a1a;
    border-radius: 4px;
    padding: 7px 12px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
}

.shop-back-btn:hover {
    color: #c9a84c;
    border-color: #c9a84c;
}

/* Rechte Spalte: Item-Grid */
#shop-stock {
    padding: 16px 14px;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

#shop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
}

.shop-slot {
    aspect-ratio: 1;
    background: rgba(255,255,255,0.03);
    border: 1px solid #5a3a1a;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    padding: 5px 4px;
    transition: all 0.2s ease;
}

.shop-slot:hover:not(.cant-afford) {
    border-color: #c9a84c;
    background: rgba(201,168,76,0.08);
}

.shop-slot.cant-afford {
    opacity: 0.4;
    cursor: not-allowed;
}

.shop-slot.rarity-uncommon { border-color: #4a7a4a; }
.shop-slot.rarity-rare     { border-color: #3a5a8a; }
.shop-slot.rarity-epic     { border-color: #6a3a8a; }
.shop-slot.rarity-legendary { border-color: #8a5a20; }

.shop-slot.rarity-uncommon:hover:not(.cant-afford) { border-color: #6aaa6a; background: rgba(74,122,74,0.1); }
.shop-slot.rarity-rare:hover:not(.cant-afford)     { border-color: #6a8acc; background: rgba(58,90,138,0.1); }
.shop-slot.rarity-epic:hover:not(.cant-afford)     { border-color: #aa6acc; background: rgba(106,58,138,0.1); }
.shop-slot.rarity-legendary:hover:not(.cant-afford) { border-color: #f0d980; background: rgba(201,168,76,0.12); }

.slot-icon-img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.slot-name {
    font-family: 'Cinzel', serif;
    font-size: 0.5rem;
    letter-spacing: 0.3px;
    color: #c9a84c;
    text-align: center;
    line-height: 1.2;
}

.slot-price {
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: #aa8040;
}

.shop-slot:hover:not(.cant-afford) .slot-price { color: #f0d980; }

/* Footer: Gold */
#shop-footer {
    border-top: 1px solid #3a2515;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    background: rgba(0,0,0,0.2);
}

.shop-gold-label {
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    letter-spacing: 2px;
    color: #8a6a3a;
    text-transform: uppercase;
}

.shop-gold-value {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    color: #c9a84c;
}

/* Responsive */
@media (max-width: 520px) {
    #shop-body {
        grid-template-columns: 1fr;
    }
    #shop-services {
        border-right: none;
        border-bottom: 1px solid #3a2515;
    }
    #shop-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Fight Overlay */
#fight-overlay {
    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: 100;
}

#fight-overlay.hidden {
    display: none;
}

#fight-panel {
    background: linear-gradient(135deg, #2a1a10, #1a0f0a);
    border: 2px solid #8B2020;
    border-radius: 12px;
    padding: 24px;
    width: 400px;
    text-align: center;
}

#fight-panel h3 {
    font-family: 'Cinzel', serif;
    color: #cc4444;
    font-size: 1.3rem;
    margin-bottom: 16px;
    letter-spacing: 2px;
}

.fight-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 16px;
}

.fight-combatant {
    text-align: center;
}

.fight-combatant .name {
    font-family: 'Cinzel', serif;
    color: #c9a84c;
    font-size: 1rem;
    margin-bottom: 4px;
}

.fight-combatant .hp-bar {
    width: 120px;
    height: 12px;
    background: #1a0f0a;
    border: 1px solid #5a3a1a;
    border-radius: 6px;
    overflow: hidden;
    margin: 4px auto;
}

.fight-combatant .hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #cc4444, #44cc44);
    transition: width 0.3s ease;
}

.fight-combatant .hp-text {
    font-size: 0.8rem;
    color: #b0a080;
}

#fight-log {
    min-height: 60px;
    margin-bottom: 12px;
    color: #e8d5b5;
    font-size: 0.95rem;
    white-space: pre-line;
}

#fight-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

#fight-actions button {
    padding: 10px 20px;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: #e8d5b5;
    background: linear-gradient(135deg, #3a2515, #2a1a10);
    border: 1px solid #5a3a1a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#fight-actions button:hover {
    background: linear-gradient(135deg, #5a3a1a, #3a2515);
    border-color: #c9a84c;
    color: #c9a84c;
}

#fight-inventory-btn {
    margin-top: 8px;
    padding: 8px 16px;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: #c9a84c;
    background: linear-gradient(135deg, #3a2515, #2a1a10);
    border: 1px solid #5a3a1a;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#fight-inventory-btn:hover {
    background: linear-gradient(135deg, #5a3a1a, #3a2515);
    border-color: #c9a84c;
}

/* Quicktime Event Overlay */
#qte-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#qte-panel {
    background: linear-gradient(135deg, #2a1a10, #1a0f0a);
    border: 2px solid #cc4444;
    border-radius: 12px;
    padding: 30px;
    width: 450px;
    text-align: center;
}

#qte-panel h3 {
    font-family: 'Cinzel', serif;
    color: #cc4444;
    font-size: 1.4rem;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

#qte-instruction {
    color: #e8d5b5;
    font-size: 1rem;
    margin-bottom: 12px;
}

#qte-progress {
    font-family: 'Cinzel', serif;
    color: #c9a84c;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

#qte-bar-container {
    margin-bottom: 20px;
}

#qte-bar {
    position: relative;
    width: 100%;
    height: 30px;
    background: #1a0f0a;
    border: 2px solid #5a3a1a;
    border-radius: 6px;
    overflow: visible;
}

#qte-cursor {
    position: absolute;
    top: -4px;
    width: 4px;
    height: 38px;
    background: #e8d5b5;
    box-shadow: 0 0 8px rgba(232, 213, 181, 0.8);
    transition: left 0.05s linear;
}

#qte-green-zone {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(68, 204, 68, 0.4);
    border-left: 2px solid #44cc44;
    border-right: 2px solid #44cc44;
}

#qte-action-btn {
    padding: 12px 30px;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a0f0a;
    background: linear-gradient(135deg, #c9a84c, #e8d5b5);
    border: 2px solid #c9a84c;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.1s ease;
}

#qte-action-btn:hover {
    background: linear-gradient(135deg, #e8d5b5, #c9a84c);
    transform: scale(1.05);
}

#qte-action-btn:active {
    transform: scale(0.95);
}

/* Footer */
#credits {
    margin-top: 30px;
    padding: 10px;
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    color: #8a6a3a;
    letter-spacing: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    #game-container {
        padding: 15px;
        gap: 15px;
    }

    #game-title {
        font-size: 1.8rem;
    }

    #hud {
        flex-wrap: wrap;
        gap: 12px 16px;
        padding: 12px;
        justify-content: space-around;
    }

    .hud-stat {
        flex: 1 1 28%;
    }

    .hud-label {
        font-size: 0.6rem;
    }

    .hud-value {
        font-size: 0.85rem;
    }

    #hud-inventory-btn,
    #hud-journal-btn {
        flex: 1 1 45%;
        margin-top: 4px;
    }

    #story-panel {
        padding: 20px;
        min-height: 150px;
    }

    #options-panel button {
        padding: 12px 18px;
        font-size: 0.9rem;
    }

    body {
        font-size: 16px;
    }

    /* Inventory responsive — untereinander */
    #inventory-panel {
        width: 95vw;
        max-width: 440px;
        max-height: 92vh;
    }

    #inventory-body {
        grid-template-columns: 1fr;
        min-height: unset;
        overflow-y: auto;
    }

    #equip-chart {
        border-right: none;
        border-bottom: 1px solid #3a2515;
        align-items: center;
        padding: 16px 12px;
    }

    .inv-panel-label {
        align-self: center;
    }

    #equip-grid {
        grid-template-columns: repeat(3, 76px);
        grid-template-rows: repeat(4, 76px);
        gap: 8px;
    }

    .equip-slot {
        width: 76px;
        height: 76px;
    }

    #inv-bag {
        padding: 16px 12px;
    }

    #bag-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 5px;
    }

    .inv-slot {
        width: 100%;
        height: 0;
        padding-bottom: 100%;
        position: relative;
    }

    .inv-slot img {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 60%;
        height: 60%;
    }

    .inv-slot .equip-badge {
        position: absolute;
        top: 4px;
        right: 4px;
        width: 14px;
        height: 14px;
        font-size: 0.55rem;
    }

    /* Changelog responsive */
    #changelog-panel {
        width: 95vw;
        max-width: 600px;
        padding: 15px;
    }

    /* Feedback responsive */
    #feedback-panel {
        width: 95vw;
        max-width: 500px;
    }

    /* Fight overlay responsive */
    #fight-panel {
        width: 95vw;
        max-width: 500px;
        padding: 15px;
    }

    /* QTE overlay responsive */
    #qte-panel {
        width: 95vw;
        max-width: 400px;
        padding: 15px;
    }

    #version-bar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 15px;
    }

    #version-bar button,
    #version-bar p {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    #game-title {
        font-size: 1.5rem;
    }

    #hud {
        font-size: 0.75rem;
    }

    #story-panel {
        padding: 15px;
    }

    #options-panel button {
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    #equip-grid {
        grid-template-columns: repeat(3, 64px);
        grid-template-rows: repeat(4, 64px);
        gap: 6px;
    }

    .equip-slot {
        width: 64px;
        height: 64px;
    }

    .equip-slot img {
        width: 36px;
        height: 36px;
    }

    #bag-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }

    body {
        font-size: 15px;
    }
}
