/* --- Grundgerüst --- */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #0f0f14;
    color: #e6e6e6;
    font-family: 'monospace', Tahoma, Geneva, Verdana, sans-serif;
}

#game-container {
    display: grid;
    grid-template-columns: 280px 1fr 250px;
    width: 100vw;
    height: 100vh;
}

/* --- Linke Sidebar (Charakter) --- */
#char-sidebar {
    background: #000;
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333;
    overflow-y: auto;
}

/* Forward/Backward Buttons oben zentriert */
.nav-buttons-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.nav-buttons-container button {
    padding: 5px 15px;
}

#game-title {
    text-align: center;
    font-size: 1.2rem;
    margin: 10px 0 10px 0;
    color: #fff;
}
#version-title {
    text-align: center;
    font-size: 0.6rem;
    margin: 0px 0 10px 0;
    color: #fff;
}
/* Charakter Bild Placeholder (Blauer Rahmen) */
#char-image-container img {
  width: 140px;
  border: 2px solid #555;
  background: #111;
}

/* Stats Bereich */
#char-stats {
    margin-bottom: 20px;
}

.bar-container {
    width: 100%;
    background: #222;
    height: 24px;
    margin: 8px 0;
    border: 1px solid #444;
}

.bar {
  width: 100%;
  height: 100%;
  transition: width 0.3s ease;
  background: #111;
  border: 1px solid #555;
}

#hp-bar { background: #ff0000; width: 100%; }
#mp-bar { background: #00adef; width: 80%; }
#xp-bar { background: #ffcc00; width: 10%; color: #000; }

/* Sidebar Buttons untereinander */
.button-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.button-column button {
    width: 100%;
    text-align: left;
    padding: 8px 15px;
}

/* --- Mittlere Spalte (Game Aufbau) --- */
#main-scene {
    background: #3a3a3a; /* Grau wie in deiner Zeichnung */
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.content-wrapper {
    width: 100%;
    max-width: 800px; /* Begrenzung des Inhalts */
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
}

#scene-image {
    width: 100%;       /* Nimmt Platz des Containers */
    max-width: 800px;  /* Aber maximal 800px */
    height: 500px;
	background: #111;
	border: 2px solid #555;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
	object-fit: cover;
}

#scene-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Story Text Bereich (Zentriert, max 600px, kein blauer Rahmen) */
#story-text {
    width: 100%;
    max-width: 600px;
    padding: 30px 10px;
    text-align: left; /* Textfluss linksbündig innerhalb der 600px */
    font-size: 1.15rem;
    line-height: 1.6;
    color: #fff;
    overflow-y: auto;
}

/* Action Buttons Bereich unten (Blauer Rahmen drumherum) */
#action-buttons {
    width: 100%;
    max-width: 800px;
    margin-bottom: 40px;
    padding: 15px;
    display: flex;
    gap: 15px;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
}

/* --- Rechte Sidebar (Quests) --- */
#quest-sidebar {
    background: #000;
    padding: 20px;
    border-left: 1px solid #333;
}

/* --- Allgemeines Button Styling --- */
button {
  background: #2d2d3d;
  border: 1px solid #555;
  color: #fff;
  padding: 8px 12px;
  cursor: pointer;
}

button:hover {
    background: #00adef;
    color: #000;
}

hr {
    border: 0;
    border-top: 1px solid #333;
    width: 100%;
    margin: 10px 0;
}
/* --- MODAL SYSTEM --- */
.hidden {
    display: none !important;
}

#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

/* Fenster Basis-Style (Last Chaos Vibe: Dunkel, Rahmen) */
.game-window {
    background: #1a1a1a;
    border: 2px solid #555;
    box-shadow: 0 0 20px #000;
    min-width: 300px;
    max-width: 500px;
    color: #eee;
    display: flex;
    flex-direction: column;
}

.window-header {
    background: linear-gradient(90deg, #333, #111);
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
    font-weight: bold;
    color: #00adef;
}

.close-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
}
.close-btn:hover { color: red; background: transparent; box-shadow: none; }

.window-content {
    padding: 15px;
}

/* --- INVENTAR GRID (5x5) --- */
#inventory-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 60px);
  gap: 8px;
  background: #0a0a0f;
  padding: 10px;
}

.inv-slot {
  background: #222;
  border: 1px solid #444;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.inv-slot:hover {
  border-color: #cd9a00;
}

.inv-slot img {
  max-width: 80%;
  max-height: 80%;
}
.item-count {
  position: absolute;
  bottom: 4px;
  right: 6px;
  font-size: 12px;
  background: rgba(0,0,0,0.6);
  padding: 1px 4px;
  border-radius: 3px;
}

/* Tooltip/Beschreibung im Inventar unten */

#item-description {
    min-height: 40px;
	width: 420px;
	max-width: 90%;
    font-size: 0.9rem;
    color: #aaa;
    border-top: 1px solid #333;
	padding: 20px;
}

/* --- SAVE / LOAD SLOTS --- */
/* --- SAVE / LOAD SYSTEM (Redesign) --- */

/* Der Container für die Slots */
#save-slots {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 5px;
}

/* Die einzelne Speicherkarte */
.save-slot {
    background: linear-gradient(180deg, #2a2a2a, #1a1a1a); /* Leichter Verlauf */
    border: 1px solid #444;
    border-left: 4px solid #555; /* Dicker Balken links */
    border-radius: 4px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

/* Hover Effekt: Heller und Goldener Rand */
.save-slot:hover {
    background: linear-gradient(180deg, #333, #222);
    border-color: #f1c40f; /* Goldener Rahmen */
    border-left-color: #f1c40f;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.1); /* Leichtes Gold-Leuchten */
    transform: translateX(5px); /* Rutscht leicht nach rechts */
}

/* Slot Nummer (Die große Zahl links) */
.slot-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #444;
    margin-right: 15px;
    min-width: 40px;
    text-align: center;
}

.save-slot:hover .slot-number {
    color: #f1c40f; /* Wird Gold beim Hover */
}

/* Infos (Name, Level, Datum) */
.slot-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.slot-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #00adef; /* Last Chaos Blau */
    margin-bottom: 2px;
}

.slot-details {
    font-size: 0.85rem;
    color: #aaa;
}

.slot-date {
    font-size: 0.75rem;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

/* Leerer Slot Design */
.slot-empty .slot-name {
    color: #555; /* Grau statt Blau */
}

.slot-empty {
    opacity: 0.7;
}
/* --- Custom Scrollbars für Webkit Browser (Chrome, Edge, Safari) --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #000; 
}
::-webkit-scrollbar-thumb {
    background: #333; 
    border-radius: 4px;
    border: 1px solid #444;
}
::-webkit-scrollbar-thumb:hover {
    background: #00adef; /* Blau beim Drüberfahren */
}
/* Style für das Namensfeld */
/* --- Styles für das Namens-Eingabe-Fenster --- */
#modal-name-input {
    position: fixed; /* WICHTIG: Löst das Fenster aus dem Layout */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Exakte Zentrierung */
    
    width: 400px;
    z-index: 3000; /* Muss höher sein als alles andere */
    
    background-color: #0f0f14; /* Dunkler Hintergrund passend zum Spiel */
    border: 2px solid #444;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9); /* Starker Schatten für "Popup"-Effekt */
    display: flex;
    flex-direction: column;
}

/* Versteckt das Fenster standardmäßig (wird von JS umgeschaltet) */
#modal-name-input.hidden {
    display: none;
}

/* Dein Style für das Eingabefeld (Focus) */
#player-name-input:focus {
    outline: none;
    border-color: #f1c40f; /* Goldener Rahmen bei Fokus */
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
    background-color: #000;
}

/* Style für den Bestätigen-Button im Popup */
#btn-confirm-name {
    margin-top: 10px;
    padding: 8px;
    background: linear-gradient(180deg, #444, #222);
    border: 1px solid #555;
    color: white;
    cursor: pointer;
    font-weight: bold;
}

#btn-confirm-name:hover {
    border-color: #f1c40f;
    color: #f1c40f;
}
/* style.css */

/* Container für das Kampf-Interface */
#battle-interface {
    text-align: center;
    margin-top: 10px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#battle-interface.hidden {
    display: none;
}

/* --- Gegner Stats & HP Balken --- */
#enemy-stats-container {
    width: 80%;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #444;
}

#battle-enemy-name {
    margin: 0 0 5px 0;
    color: #ff5555; /* Rot für Gegner */
    font-size: 1.2rem;
}

.enemy-hp-frame {
    width: 100%;
    height: 20px;
    background-color: #333;
    border: 1px solid #666;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.enemy-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #c0392b, #e74c3c); /* Schönes Rot */
    width: 100%; /* Wird per JS geändert */
    transition: width 0.3s ease-out;
}

#battle-enemy-hp-text {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: white;
    font-weight: bold;
    line-height: 20px;
    text-shadow: 1px 1px 2px black;
}

/* --- Das Kampf-LOG --- */
#battle-log {
    width: 95%;
    height: 150px; /* Feste Höhe */
    background-color: rgba(0, 0, 0, 0.8);
    border: 1px solid #555;
    border-radius: 5px;
    padding: 10px;
    overflow-y: auto; /* Scrollbar automatisch */
    text-align: left;
    font-family: 'Consolas', monospace;
    font-size: 0.95rem;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}

/* Einzelner Log-Eintrag */
.log-entry {
    margin: 2px 0;
    padding-bottom: 2px;
    border-bottom: 1px solid #222;
}

/* Scrollbar Stylen (für Chrome/Safari) */
#battle-log::-webkit-scrollbar {
    width: 8px;
}
#battle-log::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}
/* --- MONSTER BUCH STYLES --- */

/* Bereich für die Monster-Liste */
#monsterbook-content {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Überschrift des Gebiets (z.B. "Juno Lichtung") */
.mb-area-title {
    text-align: center;
    font-size: 1.2rem;
    color: #e1b12c;
    margin-bottom: 15px;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

/* Einzelner Monster-Eintrag */
.mb-entry {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #333;
}

/* Bild des Monsters im Buch */
.mb-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    margin-right: 15px;
    border: 1px solid #555;
    background: black;
}

/* Textdaten des Monsters */
.mb-info {
    flex: 1;
    font-size: 0.9rem;
}

.mb-name {
    font-weight: bold;
    color: #ff5555;
    font-size: 1rem;
}

.mb-stats {
    color: #ccc;
    font-size: 0.8rem;
}

/* Navigation unten */
.book-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #444;
}

.book-controls button {
    padding: 5px 15px;
    cursor: pointer;
}
/* --- SKILL MODAL STYLES --- */

.skill-entry {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    margin-bottom: 8px;
    padding: 10px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skill-info {
    flex: 1; /* Nimmt den meisten Platz ein */
}

.skill-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #e1b12c;
    margin-bottom: 4px;
}

.skill-type {
    font-size: 0.8rem;
    color: #aaa;
    display: inline-block;
    background: #222;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 5px;
}

.skill-desc {
    font-size: 0.9rem;
    color: #ccc;
    font-style: italic;
}

.skill-actions {
    text-align: right;
    min-width: 120px; /* Feste Breite für Buttons */
    margin-left: 10px;
}

.skill-cost {
    font-size: 0.85rem;
    margin-bottom: 5px;
    color: #ddd;
}

/* Button Zustände */
.btn-learn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 3px;
}
.btn-learn:hover { background: #2ecc71; }

.btn-disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
    border: 1px solid #444;
}

.learned-badge {
    color: #4cd137;
    font-weight: bold;
    border: 1px solid #4cd137;
    padding: 5px;
    border-radius: 3px;
    display: inline-block;
}
/* --- CLASS SPEC STYLES --- */

.spec-entry {
    background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(0,0,0,0.5));
    border: 1px solid #d4af37; /* Goldener Rand */
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.spec-entry:hover {
    transform: scale(1.02);
    background: linear-gradient(90deg, rgba(255,255,255,0.1), rgba(0,0,0,0.5));
}

.spec-icon {
    width: 64px;
    height: 64px;
    border: 2px solid #888;
    margin-right: 15px;
    background: #000;
    object-fit: cover;
}

.spec-info {
    flex: 1;
}

.spec-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #ffd700; /* Gold */
    margin-bottom: 5px;
}

.spec-desc {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.4;
}

.btn-choose-spec {
    background: #e67e22;
    color: white;
    border: 1px solid #d35400;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
}

.btn-choose-spec:hover {
    background: #d35400;
}
/* Sound Buttons */
.sound-btn {
    background: #333;
    color: #ccc;
    border: 1px solid #555;
    padding: 2px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 4px;
    width: 80px;
}

.sound-btn:hover {
    background: #444;
    color: white;
}
#btn-fullscreen {
    /* Größe festlegen für quadratischen Look */
    width: 40px; 
    height: 40px;
    margin-bottom: 10px; /* Wichtig: Padding entfernen */
    
    /* Zentrierung des Symbols */
    display: inline-flex;  /* Macht den Button zum Flex-Container */
    justify-content: center; /* Horizontal mittig */
    align-items: center;     /* Vertikal mittig */
    
    /* Text-Einstellungen */
    font-size: 1.5rem; /* Größe des Symbols */
    line-height: 1;    /* Verhindert Text-Abstände oben/unten */
    
    /* Design (optional anpassen) */
    background: #333;
    color: #fff;
    border: 1px solid #555;
    cursor: pointer;
    border-radius: 4px; /* Leicht abgerundet */
}

#btn-fullscreen:hover {
    background: #555;
    color: #e1b12c;
}