/* ===== Crafting-Rechner (/crafting, js/crafting.js) ===== */
.cr-kopf { padding: 34px 0 6px; }
.cr-kopf h1 { font-family: var(--font-title); font-size: clamp(26px, 3.6vw, 38px); color: #f1e2cf; margin: 0 0 10px; }
.cr-intro { max-width: 760px; color: var(--muted); font-size: 16px; margin: 0 0 18px; }
.cr-laden { color: var(--muted); font-style: italic; }
.cr-leer { color: var(--muted); font-size: 14px; margin: 0; }

/* Auswahl: Spiel, Art, Grundtyp, Gegenstandsstufe */
.cr-wahl { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-end; padding: 14px 16px; }
.cr-spiel { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; align-self: center; }
.cr-spiel button { background: transparent; border: 0; padding: 7px 16px; cursor: pointer; color: var(--muted); font-weight: 600; }
.cr-spiel button.active { background: linear-gradient(180deg, #8a4a1c, #5c2f10); color: #fbe6cf; }
.cr-feld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cr-feld > span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.cr-feld select, .cr-feld input[type=number], .cr-modkopf input, .cr-ziele select {
  background: #0f0d0b; border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 9px; color: var(--text); font-size: 14px; max-width: 100%;
}
.cr-feld select:focus, .cr-feld input:focus, .cr-modkopf input:focus { outline: 2px solid rgba(200, 121, 47, .5); border-color: var(--accent); }
.cr-feld--breit { flex: 1 1 240px; }
.cr-feld--breit select { width: 100%; }
.cr-stufe { display: flex; align-items: center; gap: 10px; }
.cr-stufe input[type=range] { width: 150px; accent-color: var(--accent); }
.cr-stufe input[type=number] { width: 68px; }
.cr-spieltexte { margin-left: auto; align-self: center; }

.cr-hinweis {
  margin: -6px 0 20px; padding: 12px 14px; border-radius: 6px; font-size: 14px; line-height: 1.55; color: #e6d6c2;
  background: rgba(200, 121, 47, .09); border: 1px solid rgba(200, 121, 47, .35);
}
.cr-hinweis b { color: var(--accent-2); }

.cr-raster { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
.cr-links { position: sticky; top: 76px; max-height: calc(100vh - 90px); overflow-y: auto; scrollbar-width: thin; }

/* Werkbank: Item-Karte im Spiel-Look, Orbs, Essenz */
.cr-karte { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cr-bild { max-height: 120px; max-width: 120px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .8)); }
.cr-karte .tt { width: 100%; min-width: 0; }
.cr-modzeile { display: flex; gap: 8px; align-items: baseline; justify-content: center; text-align: center; }
.cr-mz-tier { flex: none; font-family: var(--font-ui); font-size: 10px; font-weight: 700; color: #1a0f06; border-radius: 3px; padding: 0 4px; line-height: 15px; background: #8f8273; }
.cr-mz-tier.p { background: #9fb4ea; }
.cr-mz-tier.s { background: #e3c58c; }
.cr-leer.cr-leer, .cr-karte .cr-leer { font-family: var(--font-ui); font-style: italic; color: #7f7f7f; font-size: 13px; }
.cr-platz { margin: 0; font-size: 12px; color: var(--muted); }
.cr-orbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); grid-auto-rows: 1fr; gap: 8px; margin-top: 16px; }
.cr-orb {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px 6px; cursor: pointer;
  background: radial-gradient(circle at 50% 30%, rgba(200, 121, 47, .14), rgba(0, 0, 0, .25)); border: 1px solid var(--line); border-radius: 6px;
  font-size: 11.5px; line-height: 1.2; color: var(--text); text-align: center;
}
.cr-orb { min-width: 0; }
.cr-orb img { flex: none; width: 40px; height: 40px; object-fit: contain; }
/* Lange Namen (Umwandlungssphäre …) brechen auf zwei Zeilen um, statt in den Nachbarknopf zu laufen */
.cr-orb span { display: block; width: 100%; min-width: 0; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; text-wrap: balance; }
.cr-orb:hover:not(:disabled) { border-color: var(--accent); background: radial-gradient(circle at 50% 30%, rgba(200, 121, 47, .3), rgba(0, 0, 0, .25)); }
.cr-orb:active:not(:disabled) { transform: translateY(1px); }
.cr-orb:disabled { opacity: .38; cursor: not-allowed; filter: grayscale(.7); }
.cr-orb:focus-visible, .cr-stern:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.cr-essenz { display: flex; align-items: flex-end; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.cr-essenz .cr-feld { flex: 1; }
.cr-essenz select { width: 100%; }
.cr-essenz img { flex: none; align-self: center; }
.cr-essenz .btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.6); }
.cr-essenz-info { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
.cr-essenz-info .tt-mod { font-family: var(--font-item); font-size: 14px; }
.cr-aktionen { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cr-aktionen .btn:disabled { opacity: .4; cursor: not-allowed; }
.cr-verbrauch { margin-top: 14px; }
.cr-verbrauch h3, .cr-spalte h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); margin: 0 0 6px; }
.cr-verbrauch ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.cr-verbrauch li { display: flex; align-items: center; gap: 5px; }
.cr-protokoll { margin-top: 10px; font-size: 13px; color: var(--muted); }
.cr-protokoll summary { cursor: pointer; }
.cr-protokoll ol { margin: 6px 0 0; padding-left: 26px; max-height: 160px; overflow-y: auto; }

/* Mögliche Mods */
.cr-modkopf { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 12px; }
.cr-modkopf input { flex: 1 1 220px; }
.cr-modkopf p { flex: 1 1 320px; margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.cr-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cr-spalte h3 small { font-family: var(--font-ui); text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 500; margin-left: 4px; }
.cr-gruppe { border: 1px solid var(--line-soft); border-radius: 5px; margin-bottom: 6px; background: rgba(0, 0, 0, .18); }
.cr-gruppe > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 7px 9px; }
.cr-gruppe > summary::-webkit-details-marker { display: none; }
.cr-gruppe > summary:hover { background: rgba(200, 121, 47, .07); }
.cr-gruppe[open] > summary { border-bottom: 1px solid var(--line-soft); }
.cr-g-text { flex: 1; font-family: var(--font-item); color: #8888ff; font-size: 14.5px; line-height: 1.3; }
.cr-g-info { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cr-gruppe--aus { opacity: .5; }
.cr-gruppe--ziel { border-color: rgba(233, 163, 90, .6); background: rgba(200, 121, 47, .08); }
.cr-stern { flex: none; background: none; border: 0; padding: 0 2px; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; }
.cr-stern[aria-pressed=true] { color: var(--accent-2); }
.cr-tiers { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cr-tiers th { text-align: left; font-weight: 600; color: var(--muted); padding: 5px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.cr-tiers td { padding: 4px 8px; border-top: 1px solid rgba(255, 255, 255, .04); vertical-align: top; }
.cr-tiers td:nth-child(3) { width: 100%; }
.cr-tiers .tt-mod { font-family: var(--font-item); font-size: 13.5px; }
.cr-tiers small { display: block; color: var(--muted); font-size: 11.5px; }
.cr-tiers td:first-child, .cr-tiers td:nth-child(2), .cr-tiers td:nth-child(4) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cr-zu-hoch { opacity: .4; }

/* Chancen-Rechner */
.cr-ziele { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.cr-ziele li { display: flex; align-items: center; gap: 8px; font-family: var(--font-item); color: #8888ff; font-size: 14px; }
.cr-ziele li span { flex: 1; }
.cr-ziele select { font-family: var(--font-ui); padding: 4px 6px; font-size: 12.5px; }
.cr-wege { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cr-wege li { border: 1px solid var(--line-soft); border-radius: 5px; padding: 8px 10px; background: rgba(0, 0, 0, .18); }
.cr-wege li:first-child { border-color: rgba(233, 163, 90, .55); background: rgba(200, 121, 47, .08); }
.cr-weg-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; color: #ead9c4; }
.cr-weg-name img { flex: none; }
.cr-wege dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 0; }
.cr-wege dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cr-wege dd { margin: 0; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--text); }
.cr-wege li:first-child dd { color: var(--accent-2); }
.cr-fuss, .cr-exalt { font-size: 12px; color: var(--muted); margin: 10px 0 0; line-height: 1.5; }
.cr-exalt { display: flex; gap: 6px; align-items: center; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.cr-exalt img { flex: none; }
.cr-exalt b { color: var(--accent-2); }
.cr-quelle { font-size: 12px; color: var(--muted); margin: 4px 0 30px; max-width: 900px; }

@media (max-width: 980px) {
  .cr-raster { grid-template-columns: minmax(0, 1fr); }
  .cr-links { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 640px) {
  .cr-spalten { grid-template-columns: minmax(0, 1fr); }
  .cr-wahl { gap: 12px; }
  .cr-feld { flex: 1 1 100%; }
  .cr-feld select { width: 100%; }
  .cr-stufe input[type=range] { flex: 1; width: auto; }
  .cr-spieltexte { margin-left: 0; }
}
.bald-btn { margin-top: 12px; }
