/* Auth UI Styles */
#auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

#auth-container {
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #4a90e2;
  border-radius: 15px;
  padding: 30px 40px;
  width: 400px;
  box-shadow: 0 0 30px rgba(74, 144, 226, 0.3);
}

#auth-title {
  color: #4a90e2;
  text-align: center;
  margin-bottom: 20px;
  font-size: 28px;
  text-shadow: 0 0 10px rgba(74, 144, 226, 0.5);
}

#auth-tabs {
  display: flex;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #444;
  color: #888;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 16px;
}

.auth-tab:first-child {
  border-radius: 5px 0 0 5px;
}

.auth-tab:last-child {
  border-radius: 0 5px 5px 0;
}

.auth-tab.active {
  background: #4a90e2;
  color: white;
  border-color: #4a90e2;
}

.auth-tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.2);
  color: #ccc;
}

.auth-field {
  margin-bottom: 15px;
}

.auth-field label {
  display: block;
  color: #ccc;
  margin-bottom: 5px;
  font-size: 14px;
}

.auth-field input {
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #444;
  border-radius: 5px;
  color: white;
  font-size: 16px;
  box-sizing: border-box;
}

.auth-field input:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 5px rgba(74, 144, 226, 0.5);
}

#auth-submit {
  width: 100%;
  padding: 12px;
  background: #4a90e2;
  border: none;
  border-radius: 5px;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 10px;
}

#auth-submit:hover {
  background: #357abd;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(74, 144, 226, 0.4);
}

#auth-submit:active {
  transform: translateY(0);
}

#auth-submit:disabled {
  background: #555;
  cursor: not-allowed;
  transform: none;
}

#auth-message {
  margin-top: 15px;
  padding: 10px;
  border-radius: 5px;
  text-align: center;
  font-size: 14px;
  display: none;
}

#auth-message.error {
  display: block;
  background: rgba(231, 76, 60, 0.2);
  border: 1px solid #e74c3c;
  color: #e74c3c;
}

#auth-message.success {
  display: block;
  background: rgba(46, 204, 113, 0.2);
  border: 1px solid #2ecc71;
  color: #2ecc71;
}

#auth-loading {
  text-align: center;
  color: #4a90e2;
  margin-top: 15px;
  font-size: 16px;
}

/* Logout Button */
#logout-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 4px 8px;
  background: rgba(231, 76, 60, 0.6);
  border: 1px solid #e74c3c;
  border-radius: 3px;
  color: white;
  font-size: 11px;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s;
  display: none;
}

#logout-btn:hover {
  background: rgba(192, 57, 43, 0.8);
}

/* Chat UI Styles */
#chat-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 360px;
  max-height: 240px;
  background-color: rgba(0, 0, 0, 0.55);
  border-radius: 10px;
  border: 1px solid #444;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  max-height: 170px;
  font-size: 13px;
  line-height: 1.4;
}

/* Ohne Nachrichten nur die Eingabezeile zeigen — ein leerer dunkler Kasten
   verdeckt sonst ein Viertel der Welt. */
#chat-messages:empty {
  display: none;
}

#chat-messages::-webkit-scrollbar {
  width: 8px;
}

#chat-messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

#chat-messages::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.chat-message {
  margin-bottom: 5px;
  word-wrap: break-word;
}

.chat-time {
  color: #888;
  font-size: 11px;
}

.chat-username {
  color: #00ccff;
  font-weight: bold;
}

.chat-text {
  color: #ffffff;
}

.chat-system {
  color: #ffcc00;
  font-style: italic;
}

.system-message {
  opacity: 0.9;
}

#chat-input-container {
  display: flex;
  padding: 10px;
  border-top: 1px solid #444;
  background-color: rgba(0, 0, 0, 0.5);
}

#chat-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #555;
  border-radius: 5px;
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

#chat-input:focus {
  border-color: #00ccff;
  background-color: rgba(255, 255, 255, 0.15);
}

#chat-input::placeholder {
  color: #888;
}

#chat-send {
  margin-left: 8px;
  padding: 8px 16px;
  background-color: #0066cc;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s;
}

#chat-send:hover {
  background-color: #0088ff;
}

#chat-send:active {
  background-color: #0055aa;
}

/* Player Stats UI */
#stats-container {
  position: fixed;
  top: 10px;
  left: 10px;
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.8);
  border-radius: 10px;
  border: 2px solid #444;
  z-index: 1000;
  min-width: 200px;
}

#player-name {
  color: #00ff00;
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
}

#health-bar-container,
#exp-bar-container {
  position: relative;
  width: 100%;
  height: 20px;
  background-color: #333;
  border-radius: 5px;
  margin-bottom: 8px;
  overflow: hidden;
}

#health-bar {
  height: 100%;
  background: linear-gradient(90deg, #ff0000, #ff3333);
  border-radius: 5px;
  transition: width 0.3s ease;
  width: 100%;
}

#exp-bar {
  height: 100%;
  background: linear-gradient(90deg, #9933ff, #cc66ff);
  border-radius: 5px;
  transition: width 0.3s ease;
  width: 0%;
}

#health-text,
#exp-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 1px 1px 2px black;
}

#player-level {
  color: #ffcc00;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #chat-container {
    width: calc(100% - 40px);
    max-width: 400px;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    max-height: 200px;
  }

  #chat-messages {
    max-height: 130px;
  }

  #stats-container {
    min-width: 150px;
    padding: 10px;
  }

  #player-name {
    font-size: 14px;
  }

  #health-bar-container,
  #exp-bar-container {
    height: 16px;
  }
}

@media (max-width: 480px) {
  #chat-container {
    font-size: 12px;
  }

  #chat-input {
    font-size: 12px;
  }

  #stats-container {
    top: 5px;
    left: 5px;
  }
}

/* Inventory UI */
#inventory-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  max-height: 600px;
  background-color: rgba(20, 20, 30, 0.95);
  border-radius: 10px;
  border: 2px solid #555;
  z-index: 2000;
  padding: 15px;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

#inventory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 1px solid #555;
  padding-bottom: 10px;
}

#inventory-header h3 {
  margin: 0;
  color: #ffcc00;
}

#inventory-close {
  background: #cc3333;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

#inventory-close:hover {
  background: #ff4444;
}

#inventory-equipment {
  margin-bottom: 15px;
}

#inventory-equipment h4,
#inventory-stats h4,
#inventory-items h4 {
  margin: 0 0 10px 0;
  color: #aaddff;
  font-size: 14px;
}

.equip-slot {
  display: flex;
  justify-content: space-between;
  background: rgba(50, 50, 70, 0.8);
  padding: 8px 12px;
  margin-bottom: 5px;
  border-radius: 5px;
  border: 1px solid #444;
}

.equip-slot:hover {
  background: rgba(70, 70, 100, 0.8);
}

.slot-label {
  color: #888;
  font-weight: bold;
}

.slot-item {
  color: #aaffaa;
}

.slot-item.empty {
  color: #666;
  font-style: italic;
}

#inventory-stats {
  margin-bottom: 15px;
  background: rgba(40, 40, 60, 0.8);
  padding: 10px;
  border-radius: 5px;
}

#inventory-stats div {
  margin-bottom: 3px;
}

#stat-attack { color: #ff6666; }
#stat-defense { color: #66aaff; }
#stat-maxhealth { color: #66ff66; }

#inventory-items {
  margin-bottom: 10px;
}

#inventory-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding: 5px;
  background: rgba(30, 30, 50, 0.8);
  border-radius: 5px;
}

.inventory-slot {
  background: rgba(60, 60, 80, 0.8);
  border: 1px solid #555;
  border-radius: 5px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  position: relative;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.inventory-slot:hover {
  background: rgba(80, 80, 120, 0.8);
  border-color: #888;
}

.inventory-slot .item-name {
  font-size: 11px;
  color: #ddd;
  word-break: break-word;
}

.inventory-slot .item-quantity {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 10px;
  color: #ffcc00;
  font-weight: bold;
}

.inventory-slot.rarity-common { border-color: #888; }
.inventory-slot.rarity-uncommon { border-color: #00cc00; }
.inventory-slot.rarity-rare { border-color: #0066ff; }
.inventory-slot.rarity-epic { border-color: #cc00cc; }

#inventory-gold {
  color: #ffcc00;
  font-weight: bold;
  text-align: right;
  border-top: 1px solid #555;
  padding-top: 10px;
}

/* Item context menu */
.item-context-menu {
  position: absolute;
  background: rgba(30, 30, 40, 0.98);
  border: 1px solid #666;
  border-radius: 5px;
  padding: 5px 0;
  z-index: 3000;
  min-width: 120px;
}

.item-context-menu button {
  display: block;
  width: 100%;
  padding: 8px 15px;
  background: none;
  border: none;
  color: #ddd;
  text-align: left;
  cursor: pointer;
}

.item-context-menu button:hover {
  background: rgba(80, 80, 120, 0.8);
  color: #fff;
}

/* Loot notification */
.loot-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(30, 30, 40, 0.95);
  border: 2px solid #ffcc00;
  border-radius: 10px;
  padding: 20px;
  z-index: 2500;
  color: #ffffff;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.loot-notification h3 {
  color: #ffcc00;
  margin: 0 0 15px 0;
}

.loot-item {
  padding: 5px;
  margin: 5px 0;
  color: #aaffaa;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Shop UI */
#shop-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  max-height: 700px;
  background-color: rgba(25, 25, 40, 0.98);
  border-radius: 10px;
  border: 2px solid #aa8844;
  z-index: 2000;
  padding: 15px;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

#shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  border-bottom: 2px solid #aa8844;
  padding-bottom: 10px;
}

#shop-header h3 {
  margin: 0;
  color: #ffcc00;
}

#shop-gold {
  color: #ffcc00;
  font-weight: bold;
}

#shop-close {
  background: #cc3333;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

#shop-close:hover {
  background: #ff4444;
}

#shop-npc-message {
  background: rgba(50, 50, 70, 0.8);
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 10px;
  font-style: italic;
  color: #aaddff;
  min-height: 20px;
}

#shop-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}

.shop-tab {
  flex: 1;
  padding: 10px;
  background: rgba(60, 60, 80, 0.8);
  border: 1px solid #555;
  border-radius: 5px 5px 0 0;
  color: #aaa;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.shop-tab:hover {
  background: rgba(80, 80, 100, 0.8);
  color: #fff;
}

.shop-tab.active {
  background: rgba(100, 100, 140, 0.8);
  color: #ffcc00;
  border-bottom-color: transparent;
}

#shop-items {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  background: rgba(30, 30, 50, 0.8);
  border-radius: 5px;
  margin-bottom: 10px;
}

.shop-item {
  background: rgba(60, 60, 80, 0.8);
  border: 1px solid #555;
  border-radius: 5px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  position: relative;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: all 0.2s;
}

.shop-item:hover {
  background: rgba(80, 80, 120, 0.8);
  border-color: #888;
  transform: scale(1.05);
}

.shop-item.selected {
  border-color: #ffcc00;
  background: rgba(100, 100, 140, 0.8);
}

.shop-item .item-name {
  font-size: 12px;
  color: #ddd;
  word-break: break-word;
  margin-bottom: 5px;
}

.shop-item .item-price {
  font-size: 11px;
  color: #ffcc00;
  font-weight: bold;
}

.shop-item .item-stock {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 10px;
  color: #88ff88;
}

.shop-item.out-of-stock {
  opacity: 0.5;
  cursor: not-allowed;
}

.shop-item.out-of-stock .item-stock {
  color: #ff4444;
}

.shop-item.rarity-common { border-left: 3px solid #888; }
.shop-item.rarity-uncommon { border-left: 3px solid #00cc00; }
.shop-item.rarity-rare { border-left: 3px solid #0066ff; }
.shop-item.rarity-epic { border-left: 3px solid #cc00cc; }

#shop-item-details {
  background: rgba(40, 40, 60, 0.9);
  padding: 15px;
  border-radius: 5px;
  border: 1px solid #555;
  min-height: 120px;
}

.sell-btn-inline {
  background: rgba(80, 140, 80, 0.9);
  color: #fff;
  border: 1px solid #4a7;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.15s;
}

.sell-btn-inline:hover {
  background: rgba(100, 170, 100, 1);
}

.sell-btn-inline.sell-btn-all {
  background: rgba(80, 100, 160, 0.9);
  border-color: #68a;
}

.sell-btn-inline.sell-btn-all:hover {
  background: rgba(100, 120, 190, 1);
}

#shop-item-name {
  color: #ffcc00;
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 8px;
}

#shop-item-desc {
  color: #aaa;
  font-size: 12px;
  margin-bottom: 8px;
}

#shop-item-stats {
  color: #88ff88;
  font-size: 12px;
  margin-bottom: 8px;
}

#shop-item-price {
  color: #ffcc00;
  font-weight: bold;
  margin-bottom: 10px;
}

#shop-action-btn {
  background: #228822;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  transition: background 0.2s;
}

#shop-action-btn:hover {
  background: #33aa33;
}

#shop-action-btn:disabled {
  background: #555;
  cursor: not-allowed;
}

#shop-action-btn.sell-btn {
  background: #cc6600;
}

#shop-action-btn.sell-btn:hover {
  background: #ff8800;
}

/* Quest UI */
#quest-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 650px;
  max-height: 700px;
  background-color: rgba(25, 25, 40, 0.98);
  border-radius: 10px;
  border: 2px solid #4a8844;
  z-index: 2000;
  padding: 15px;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

#quest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  border-bottom: 2px solid #4a8844;
  padding-bottom: 10px;
}

#quest-header h3 {
  margin: 0;
  color: #88ff88;
}

#quest-close {
  background: #cc3333;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

#quest-close:hover {
  background: #ff4444;
}

#quest-npc-message {
  background: rgba(50, 70, 50, 0.8);
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 10px;
  font-style: italic;
  color: #aaffaa;
  min-height: 20px;
}

#quest-content {
  display: flex;
  gap: 10px;
}

#quest-list {
  flex: 1;
  max-height: 400px;
  overflow-y: auto;
  background: rgba(30, 30, 50, 0.8);
  border-radius: 5px;
  padding: 10px;
}

.quest-item {
  background: rgba(60, 60, 80, 0.8);
  border: 1px solid #555;
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.quest-item:hover {
  background: rgba(80, 80, 120, 0.8);
  border-color: #888;
}

.quest-item.selected {
  border-color: #88ff88;
  background: rgba(70, 100, 70, 0.8);
}

.quest-item-name {
  font-weight: bold;
  color: #ddd;
  margin-bottom: 5px;
}

.quest-item-status {
  font-size: 11px;
  font-weight: bold;
}

.quest-available .quest-item-status {
  color: #ffcc00;
}

.quest-active .quest-item-status {
  color: #aaaaff;
}

.quest-completed .quest-item-status {
  color: #88ff88;
}

.no-quests {
  color: #888;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

#quest-details {
  flex: 1.5;
  background: rgba(40, 40, 60, 0.9);
  padding: 15px;
  border-radius: 5px;
  border: 1px solid #555;
}

#quest-title {
  color: #ffcc00;
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 10px;
}

#quest-desc {
  color: #ccc;
  font-size: 13px;
  margin-bottom: 15px;
  line-height: 1.4;
}

#quest-objectives h4,
#quest-rewards h4 {
  color: #aaddff;
  font-size: 14px;
  margin: 0 0 8px 0;
}

.quest-objective {
  display: flex;
  justify-content: space-between;
  padding: 5px;
  background: rgba(50, 50, 70, 0.8);
  border-radius: 3px;
  margin-bottom: 5px;
  font-size: 12px;
}

.objective-complete {
  color: #88ff88;
  text-decoration: line-through;
}

.objective-progress {
  color: #ffcc00;
  font-weight: bold;
}

.quest-reward-list {
  background: rgba(50, 50, 70, 0.8);
  padding: 8px;
  border-radius: 3px;
}

.reward-item {
  color: #88ff88;
  font-size: 12px;
  margin-bottom: 3px;
}

#quest-action-btn {
  background: #228822;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  margin-top: 15px;
  transition: background 0.2s;
}

#quest-action-btn:hover {
  background: #33aa33;
}

#quest-action-btn:disabled {
  background: #555;
  cursor: not-allowed;
}

/* Quest Tracker (HUD) */
/* Ohne aktive Quests nichts zeigen — ein Kasten mit „No active quests"
   kostet nur Platz. QuestUI.updateTracker setzt die Klasse. */
#quest-tracker.is-empty {
  display: none;
}

#quest-tracker {
  position: fixed;
  top: 90px;
  right: 10px;
  width: 250px;
  background-color: rgba(0, 0, 0, 0.75);
  border-radius: 10px;
  border: 1px solid #4a8844;
  z-index: 1000;
  padding: 10px;
  color: #ffffff;
  font-size: 12px;
}

#quest-tracker-title {
  color: #88ff88;
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 8px;
  border-bottom: 1px solid #4a8844;
  padding-bottom: 5px;
}

.tracker-quest {
  margin-bottom: 10px;
}

.tracker-quest-name {
  color: #ffcc00;
  font-weight: bold;
  margin-bottom: 3px;
}

.tracker-objective {
  color: #ccc;
  font-size: 11px;
  margin-left: 10px;
  margin-bottom: 2px;
}

.tracker-objective.complete {
  color: #88ff88;
  text-decoration: line-through;
}

/* Crafting UI */
#crafting-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 560px;
  max-height: 700px;
  background-color: rgba(25, 25, 40, 0.98);
  border-radius: 10px;
  border: 2px solid #cc8844;
  z-index: 2000;
  padding: 15px;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  display: flex;
  flex-direction: column;
}

#crafting-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  border-bottom: 2px solid #cc8844;
  padding-bottom: 10px;
}

#crafting-header h3 {
  margin: 0;
  color: #ffbb66;
}

#crafting-close {
  background: #cc3333;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

#crafting-close:hover {
  background: #ff4444;
}

#crafting-npc-message {
  background: rgba(50, 50, 70, 0.8);
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 10px;
  font-style: italic;
  color: #ffddaa;
  min-height: 20px;
}

#crafting-recipes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 500px;
  overflow-y: auto;
  padding: 6px 4px;
}

.crafting-recipe {
  background: rgba(40, 40, 60, 0.85);
  border: 1px solid #5a4a33;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.crafting-recipe.rarity-uncommon { border-color: #66aa66; }
.crafting-recipe.rarity-rare     { border-color: #5577cc; }
.crafting-recipe.rarity-epic     { border-color: #aa66cc; }

.crafting-recipe-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.crafting-recipe .recipe-name {
  color: #ffcc00;
  font-weight: bold;
  font-size: 15px;
}

.crafting-recipe .recipe-stats {
  color: #88ddff;
  font-size: 12px;
}

.crafting-recipe .recipe-desc {
  color: #bbb;
  font-size: 12px;
  font-style: italic;
}

.recipe-ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ingredient {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.ingredient-have {
  background: rgba(70, 130, 70, 0.4);
  color: #c8ffc8;
  border: 1px solid rgba(120, 200, 120, 0.5);
}

.ingredient-missing {
  background: rgba(130, 60, 60, 0.4);
  color: #ffc8c8;
  border: 1px solid rgba(200, 100, 100, 0.5);
}

.craft-btn {
  align-self: flex-end;
  background: #cc8844;
  color: white;
  border: none;
  padding: 6px 18px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.15s;
}

.craft-btn:hover:not(:disabled) {
  background: #dd9955;
}

.craft-btn:disabled {
  background: #555;
  color: #999;
  cursor: not-allowed;
}

.crafting-empty {
  text-align: center;
  color: #888;
  padding: 20px;
  font-style: italic;
}

@media (max-width: 768px) {
  #crafting-container {
    width: calc(100% - 32px);
    max-height: calc(100vh - 80px);
  }
}
