/* Grundlayout */
body {
  margin: 0;
  font-family: 'Cinzel', serif;
  background-color: #1e1b2c;
  color: #f5f5dc;
}

header {
  background-color: #2c2540;
  padding: 20px;
  text-align: center;
}

.logo img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
}

nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 30px;
}

nav a {
  color: #ffd700;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.75em;
  font-family: 'Cinzel', serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 12px;
  transition: color 0.3s;
}

nav a:hover {
  color: #e6c200;
}

footer {
  text-align: center;
  padding: 20px;
  background-color: #2c2540;
  font-size: 0.9em;
}

main {
  padding: 40px 20px;
  max-width: 1000px;
  margin: auto;
}

/* NPC-Info Box */
.npc-info {
  background-color: #2e2a3f;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
}

.npc-info p {
  font-size: 1.1em;
  color: #c0b283;
}

/* Item-Grid */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

/* Inline-Header innerhalb des Grids */
.item-grid .inline-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
}

.item-grid .inline-header img {
  max-height: 80px;
  width: auto;
  border-radius: 6px;
}

.item-grid .inline-header h2 {
  font-size: 1.8em;
  color: #ffd700;
  margin: 0;
}

/* Item-Karten */
.item-card {
  background-color: #2c2540;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 0 12px rgba(0,0,0,0.4);
}

.item-card img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  margin-bottom: 12px;
  border-radius: 6px;
}

.item-card h3 {
  margin: 0 0 8px;
  color: #ffd700;
}

.item-card p {
  margin: 0;
  font-size: 1em;
  color: #c0b283;
}

.item-card a {
  display: inline-block;
  color: #ffd700;
  text-decoration: none;
  font-weight: bold;
  line-height: 1.3;
}

.item-card img:not(.currency-icon) {
  cursor: pointer;
}

/* Währung */
.currency {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.currency-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  position: relative;
  top: 3px;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(30, 27, 44, 0.95);
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(2px);
}

.lightbox-img {
  max-width: 90%;
  max-height: 90%;
  border: 2px solid #ffd700;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.7);
  transition: transform 180ms ease, opacity 180ms ease;
}

.lightbox .close {
  position: absolute;
  top: 30px;
  right: 40px;
  font-size: 2em;
  color: #ffd700;
  cursor: pointer;
}

/* NPC-Intro */
.npc-intro {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  align-items: flex-start;
  background-color: #2e2a3f;
  padding: 30px;
  border-radius: 8px;
  margin-bottom: 40px;
}

.npc-image img {
  max-width: 280px;
  border-radius: 8px;
  border: 2px solid #ffd700;
  box-shadow: 0 0 12px rgba(0,0,0,0.5);
  cursor: pointer;
}

.npc-text {
  flex: 1;
  min-width: 250px;
}

.npc-text h2 {
  font-size: 1.8em;
  color: #ffd700;
  margin-bottom: 10px;
}

.npc-text p {
  font-size: 1.1em;
  color: #c0b283;
  margin-bottom: 10px;
}

/* Copy-to-Clipboard */
.copy-text {
  cursor: pointer;
}

.copy-text:hover {
  text-decoration: underline;
}

.copy-message {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #2c2540;
  color: #ffd700;
  padding: 10px 16px;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  font-weight: bold;
  z-index: 9999;
}

/* Anchor-Navigation */
.anchor-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px 20px; /* vertikal & horizontal getrennt */
  background-color: #2c2540;
  padding: 20px 40px;
  border-top: 2px solid #444;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.3);
  max-width: 1000px;
  margin: auto;
}

.anchor-nav a {
  flex: 1 1 160px; /* gleichmäßige Breite, aber flexibel */
  text-align: center;
  padding: 8px 12px;
  border: 1px solid #ffd700;
  border-radius: 4px;
  color: #ffd700;
  font-weight: bold;
  text-decoration: none;
  transition: background-color 0.3s;
}

.anchor-nav a:hover {
  background-color: #ffd700;
  color: #1e1b2c;
}

.anchor-nav.is-stuck {
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
}

/* Responsive Anpassungen */
@media (max-width: 900px) {
  .inline-header { flex-direction: column; gap: 12px; }
  .item-grid { gap: 20px; }
  .anchor-nav { padding: 14px; gap: 10px; }
  .crafting-summary { margin: 24px auto; padding: 24px 16px; }
}

@media (max-width: 600px) {
  .anchor-nav a { padding: 6px 10px; font-size: 0.95rem; }
  .item-card { padding: 16px; }
  .button-row { gap: 12px; }
  #backToTop { width: 44px; height: 44px; font-size: 1.25em; }
  .item-grid { gap: 22px; }
}

.item-grid .inline-header {
      grid-column: 1 / -1;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 20px;
      margin-bottom: 10px;
    }
    .item-grid .inline-header img {
      max-height: 80px;
      width: auto;
      border-radius: 6px;
    }
    .item-grid .inline-header h2 {
      font-size: 1.8em;
      color: #ffd700;
      margin: 0;
    }

.item-grid .npc-intro {
  grid-column: 1 / -1;
  margin-bottom: 30px;
}

/* Abstand unter jeder Item-Grid-Section */
.item-grid {
  margin-bottom: 60px;
}

/* Back-to-Top Button */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: #ffd700;
  color: #1e1b2c;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.5em;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  transition: background-color 0.3s;
  z-index: 1000;
}

#backToTop:hover {
  background-color: #e6c200;
}

/* Optional: Sticky mit Schatten beim Anhaften (visuelles Feedback) */
.anchor-nav.is-stuck {
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
}

/* Mobile Optimierungen */
@media (max-width: 900px) {
  .inline-header { flex-direction: column; gap: 12px; }
  .item-grid { gap: 20px; }
  .anchor-nav { padding: 14px; gap: 10px; }
  .crafting-summary { margin: 24px auto; padding: 24px 16px; }
}

/* Sehr kleine Geräte */
@media (max-width: 600px) {
  .anchor-nav a { padding: 6px 10px; font-size: 0.95rem; }
  .item-card { padding: 16px; }
  .button-row { gap: 12px; }
  #backToTop { width: 44px; height: 44px; font-size: 1.25em; }
}
