/* --- GLOBALE STYLES --- */
* { box-sizing: border-box; font-family: "Courier New", Courier, monospace; }

body {
  background-color: #000033;
  background-image: radial-gradient(#1a1a4a 1px, transparent 0);
  background-size: 8px 8px;
  color: #00ffcc;
  margin: 0;
  padding: 15px;
  font-size: 13px;
}

a { color: #ffff00; font-weight: bold; text-decoration: underline; }
a:hover { color: #ff00ff; background: #ffff00; text-decoration: none; }

#site-wrapper {
  max-width: 960px;
  margin: 0 auto;
  background: #0a0a1f;
  border: 4px ridge #444499;
  box-shadow: 5px 5px 15px #000;
  padding: 10px;
}

/* --- HEADER & NAV --- */
header {
  background: #111144;
  border: 3px outset #6666cc;
  padding: 15px;
  text-align: center;
  margin-bottom: 10px;
}

h1 {
  color: #ff007f;
  text-shadow: 2px 2px #ffff00;
  margin: 0;
  font-size: 28px;
  letter-spacing: 2px;
}

.marquee-box {
  background: #000;
  border: 2px inset #444;
  color: #00ff00;
  padding: 4px;
  margin-top: 10px;
  font-weight: bold;
}

nav {
  background: #222266;
  border: 3px outset #444499;
  padding: 6px;
  display: flex;
  justify-content: space-around;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

nav a {
  color: #ffffff;
  background: #000066;
  border: 2px outset #6666cc;
  padding: 4px 10px;
  text-decoration: none;
  font-size: 12px;
}

nav a:hover { border-style: inset; background: #660066; color: #fff; }

/* --- LAYOUT GRID --- */
.layout-grid {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.sidebar {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.box {
  background: #050515;
  border: 3px outset #444499;
  padding: 10px;
}

.box h3 {
  margin: 0 0 8px 0;
  background: #222266;
  color: #ffff00;
  padding: 3px 6px;
  border: 1px inset #000;
  font-size: 13px;
}

.main-content {
  flex: 3 1 680px;
}

/* --- WINDOWS & BLOG & GUESTBOOK --- */
.window-frame {
  background: #000044;
  border: 4px outset #8888cc;
  margin-bottom: 20px;
}

.window-header {
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff;
  padding: 4px 8px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #000;
}

.blog-post {
  background: #0a0a1f;
  border: 2px inset #444499;
  padding: 10px;
  margin-bottom: 15px;
}

.blog-date { color: #ffff00; font-size: 11px; border-bottom: 1px dashed #444499; margin-bottom: 5px; padding-bottom: 3px; }

.retro-input, .retro-textarea {
  background: #000;
  border: 2px inset #6666cc;
  color: #00ffcc;
  padding: 5px;
  font-family: inherit;
  width: 100%;
  margin-bottom: 10px;
}

.retro-textarea { resize: vertical; min-height: 60px; }
.retro-input:focus, .retro-textarea:focus { outline: none; border-color: #ff00ff; }

.gb-entry {
  background: #111144;
  border: 1px solid #444499;
  padding: 8px;
  margin-top: 10px;
  border-left: 4px solid #ff007f;
}

.gb-date { font-size: 10px; color: #888; }

/* --- BUTTONS --- */
.btn-toggle-window {
  background: #ffcc00;
  color: #000;
  border: 2px outset #fff;
  font-weight: bold;
  cursor: pointer;
  padding: 4px 10px;
  font-size: 12px;
}

.btn-toggle-window:hover { background: #ff007f; color: #fff; border-style: inset; }

.btn-submit {
  background: #00ff00;
  color: #000;
  border: 2px outset #fff;
  font-weight: bold;
  cursor: pointer;
  padding: 6px 15px;
  font-size: 13px;
}

.btn-submit:hover { border-style: inset; background: #00cc00; }

.btn-action { background: #ffb400; color: #000; border: 2px outset #fff; padding: 4px 8px; font-weight: bold; font-size: 11px; cursor: pointer; }
.btn-action:hover:not(:disabled) { border-style: inset; background: #ffd700; }
.btn-action:disabled { background: #555; color: #888; border-color: #333; cursor: not-allowed; }

/* --- COLLAPSIBLE WRAPPERS --- */
#game-wrapper, #blog-wrapper, #guestbook-wrapper { display: none; }
#game-wrapper { padding: 10px; background: #111; }
#blog-wrapper, #guestbook-wrapper { padding: 15px; background: #050515; }
#game-wrapper.open, #blog-wrapper.open, #guestbook-wrapper.open { display: block; }

/* --- RPG ENGINE STYLES (FIXED FLEXBOX) --- */
#game-layout {
  display: flex;
  flex-wrap: nowrap; 
  gap: 10px;
}

#rpg-main-screen {
  flex: 1; 
  height: 420px;
  background: #0a0a1f;
  border: 3px inset #666;
  position: relative;
  overflow-y: auto;
  padding: 15px;
}

#game-sidebar {
  width: 230px; 
  flex-shrink: 0; 
  background: #1c150e;
  border: 3px outset #5c4033;
  padding: 8px;
  color: #f0e6d2;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rpg-screen { display: none; height: 100%; flex-direction: column; }
.rpg-screen.active { display: flex; }

.screen-title {
  font-size: 18px;
  color: #ffb400;
  border-bottom: 2px dashed #444499;
  padding-bottom: 5px;
  margin-top: 0;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-row { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 2px; }
.progress-bar { height: 10px; background: #000; border: 1px solid #5c4033; border-radius: 2px; overflow: hidden; margin-bottom: 6px; position: relative;}
.progress-fill { height: 100%; background: #00e676; width: 0%; transition: width 0.3s; }
.progress-fill.energy { background: #29b6f6; }
.progress-fill.xp { background: #ab47bc; }

.rpg-nav-btn {
  background: #3d281c; color: #ffb400; border: 2px outset #5c4033;
  padding: 8px; cursor: pointer; font-weight: bold; font-size: 12px;
  text-align: left; transition: 0.1s;
}
.rpg-nav-btn:hover:not(:disabled) { border-color: #ffcc00; }
.rpg-nav-btn.active { background: #6e4c35; color: #fff; border-style: inset; }
.rpg-nav-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.quest-card {
  background: #111144;
  border: 2px outset #444499;
  padding: 10px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.quest-info { flex: 1; }
.quest-title { font-weight: bold; color: #ff007f; font-size: 14px; margin-bottom: 5px; }
.quest-rewards { font-size: 11px; color: #aaa; }
.quest-danger { font-size: 11px; color: #ff5252; font-weight: bold; margin-top: 4px; }

.shop-item {
  background: #2b1d14; border: 2px outset #5c4033; padding: 10px; margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center; font-size: 11px;
}

.char-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.char-box { background: #000; border: 1px solid #444499; padding: 10px; }
.char-stat { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; border-bottom: 1px dotted #333; }

#log-box {
  width: 100%; height: 80px; background: #000; border: 2px inset #444;
  margin-top: 8px; padding: 5px; overflow-y: auto; font-size: 11px; color: #ffcc00;
}

#sidebar-task-widget {
  background: #221100; border: 2px solid #ff5252; padding: 8px; margin-top: 10px; display: none;
}
#sidebar-task-widget.active { display: block; }

/* --- NEU: Pop-up & Item Rarities --- */
#quest-popup {
  display: none;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #0a0a1f;
  border: 4px ridge #ffb400;
  padding: 20px;
  z-index: 100;
  text-align: center;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
  width: 80%;
}
#quest-popup.active { display: block; }

.save-code-box { width: 100%; background:#111; color:#00ff00; border:1px solid #444; font-size:10px; padding:4px; margin-top:5px; }

/* --- FOOTER --- */
footer {
  margin-top: 15px;
  background: #111144;
  border: 3px outset #444499;
  padding: 10px;
  text-align: center;
  font-size: 11px;
}
.counter {
  background: #000; color: #00ff00; border: 2px inset #666;
  padding: 2px 6px; font-family: monospace; font-weight: bold;
  font-size: 16px; letter-spacing: 2px;
}

/* --- NEUE RPG v4.0 STYLES --- */

/* Buttons für die Attributs-Punkte */
.stat-btn { 
  background: #444; 
  color: #fff; 
  border: 1px solid #777; 
  cursor: pointer; 
  border-radius: 3px; 
  font-weight: bold; 
  width: 20px; 
  height: 20px; 
  line-height: 15px; 
  padding: 0; 
}

.stat-btn:hover { 
  background: #00ffcc; 
  color: #000; 
}

/* Layout für die Items im Rucksack */
.inventory-item { 
  background: #111; 
  border: 1px solid #333; 
  padding: 8px; 
  margin-bottom: 5px; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
}

.inventory-actions button { 
  font-size: 10px; 
  padding: 4px 8px; 
  margin-left: 5px; 
}

/* --- NEUE RPG v5.0 STYLES (FARBEN & UTILITIES) --- */

/* Item Seltenheitsstufen */
.rarity-common { color: #aaaaaa; }
.rarity-rare { color: #42a5f5; }
.rarity-epic { color: #ff00ff; font-weight: bold; } /* Neon-Magenta für Epic */
.rarity-legendary { color: #ffb400; font-weight: bold; text-shadow: 0 0 5px #ffb400; }

/* Textfarben für Logs & UI */
.text-danger { color: #ff5252; }
.text-success { color: #00ffcc; } /* Dein globales Retro-Cyan */
.text-gold { color: #ffff00; } /* Dein globales Retro-Gelb */
.text-muted { color: #888888; }
.text-epic { color: #ff00ff; font-weight: bold; }

/* Boss Quest Styling */
.text-boss { 
  color: #ff007f; 
  text-shadow: 1px 1px #ffff00; 
}

/* Roter Gefahren-Button (z.B. für's Verkaufen) */
.btn-danger { 
  background: #ff5252; 
  color: #fff; 
}
.btn-danger:hover:not(:disabled) { 
  background: #cc0000; 
  border-style: inset; 
}

/* --- KLASSENWAHL STYLES --- */
.class-card {
  background: #111144;
  border: 3px outset #444499;
  padding: 15px;
  flex: 1;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.class-card:hover {
  border-style: inset;
  border-color: #ffb400;
  background: #222266;
  transform: translateY(-5px);
}