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;
}

.intro {
    text-align: center;
    padding: 40px;
    background-color: #2e2a3f;
}

.cta-button {
    background-color: #ffd700;
    color: #1e1b2c;
    padding: 10px 20px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
}

.preview {
    padding: 40px;
    background-color: #3a3450;
}

.preview-grid {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.preview-item img {
    width: 100%;
    max-width: 250px;
    border: 2px solid #ffd700;
    border-radius: 8px;
}

footer {
    text-align: center;
    padding: 20px;
    background-color: #2c2540;
    font-size: 0.9em;
}

.crafted-section {
  padding: 40px;
  background-color: #2e2a3f;
  color: #f5f5dc;
  text-align: center;
}

.crafted-section h2 {
  font-family: 'Cinzel', serif;
  font-size: 2em;
  color: #ffd700;
  margin-bottom: 40px;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
}

.item-card {
  background-color: #1e1b2c;
  border: 1px solid #444;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  text-align: left;
}

.item-card img {
  width: 100%;
  border-radius: 6px;
  margin-bottom: 15px;
}

.item-card h3 {
  color: #ffd700;
  font-size: 1.2em;
  margin-bottom: 10px;
}

.item-card ul {
  list-style: none;
  padding-left: 0;
  line-height: 1.6;
}

.item-card li::before {
  content: "• ";
  color: #c0b283;
}

.inline-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
}

.inline-header img {
  max-height: 80px;
  width: auto;
  border-radius: 6px;
}

.inline-header h2 {
  font-size: 1.8em;
  color: #ffd700;
  margin: 0;
}

/* Anchor navigation feststehend */
.anchor-nav {
  position: sticky;   /* bleibt oben kleben beim Scrollen */
  top: 0;
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  background-color: #2c2540;
  padding: 20px;
  border-top: 2px solid #444;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.3);
}

.anchor-nav a {
  color: #ffd700;
  font-weight: bold;
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid #ffd700;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.anchor-nav a:hover {
  background-color: #ffd700;
  color: #1e1b2c;
}

#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;
}

.crafting-summary {
  background-color: #1e1b2c;
  padding: 40px 20px;
  margin: 40px auto;
  max-width: 800px;
  border: 1px solid #444;
  border-radius: 12px;
  color: #ffd700;
  text-align: center;
}

.crafting-summary button {
  background-color: #ffd700;
  color: #1e1b2c;
  border: none;
  padding: 10px 20px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 20px;
}

#materialResults {
  text-align: left;
  margin-top: 20px;
  font-size: 1em;
  color: #c0b283;
}

.craft-select {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #ffd700;
  border-radius: 4px;
  background-color: #1e1b2c;
  cursor: pointer;
  position: relative;
  margin-bottom: 10px;
  transition: background-color 0.2s ease;
}

.craft-select:checked {
  background-color: #ffd700;
}

.craft-select:checked::after {
  content: "✔";
  color: #1e1b2c;
  font-size: 14px;
  position: absolute;
  top: 1px;
  left: 3px;
}

.item-card.selected {
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  border: 2px solid #ffd700;
  transition: box-shadow 0.3s ease, border 0.3s ease;
}

.button-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.button-row button {
  background-color: #ffd700;
  color: #1e1b2c;
  border: none;
  padding: 10px 20px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.button-row button:hover {
  background-color: #e6c200;
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  padding: 10px 0;
}

.material-entry {
  background-color: #2c2540;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ffd700;
  font-family: 'Segoe UI', sans-serif;
}

.material-qty {
  font-weight: bold;
  color: #e6c200;
}

.material-name {
  text-align: right;
}

.crafted-item {
  margin-bottom: 15px;
}

.card-control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.amount-field {
  width: 80px;
  padding: 6px;
  border-radius: 4px;
  border: 1px solid #444;
  background-color: #1c1a2e;
  color: #f5f5dc;
  font-weight: bold;
}

/* Doppelte Definition entfernt und vereinheitlicht (siehe oben) */
/* craft-select bereits definiert */

/* Menge / Anzahl-Eingabe */
.amount-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.amount-label {
  font-weight: bold;
  color: #ffd700;
  user-select: none;
}

/* kompakteres Feld für kleine Karten */
.amount-field {
  width: 40px;
  padding: 6px;
  border-radius: 4px;
  border: 1px solid #444;
  background-color: #1c1a2e;
  color: #f5f5dc;
  font-weight: bold;
}

/* 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; }
}
