/* =========================
   Grundlayout
========================= */

* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #1e1e1e;
    color: white;
    margin: 0;
    padding: 20px;
    text-align: center;
}

h1 {
    color: #7CFC7C;
}

h2 {
    margin-top: 25px;
    color: #dddddd;
}

.container {
    background: #2c2c2c;
    padding: 20px;
    margin: 0 auto;
    width: 100%;
    max-width: 900px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.35);
}

label {
    font-weight: bold;
}

select {
    width: 100%;
    padding: 8px;
    margin: 8px 0 12px 0;
    background: #1e1e1e;
    color: white;
    border: 1px solid #555;
    border-radius: 6px;
}

button {
    margin-top: 15px;
    padding: 12px 18px;
    width: 100%;
    background: #2e8b57;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

button:hover {
    background: #3cb371;
}

hr {
    border: none;
    border-top: 1px solid #555;
    margin: 12px 0;
}

.hint {
    color: #cfcfcf;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.hidden {
    display: none;
}


/* =========================
   Kopfbereich
========================= */

.app-header {
    max-width: 980px;
    margin: 30px auto 28px;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
}

.app-header h1 {
    grid-column: 2;
    margin: 0;
    font-size: 2rem;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
}

.language-switcher {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.language-switcher label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
}

.language-switcher select {
    width: auto;
    min-width: 74px;
    margin: 0;
    padding: 7px 10px;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 8px;
}


/* =========================
   Verzauberungs-Auswahl
========================= */

.enchant-grid {
    text-align: left;
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.enchant-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: #3a3a3a;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    min-height: 66px;
}

.enchant-option:hover {
    background: #4a4a4a;
}

.enchant-text {
    flex: 1;
}

.enchant-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
}

.enchant-label input {
    cursor: pointer;
}

.level-select {
    width: 75px;
    padding: 6px;
    margin: 0;
}

.level-select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.enchant-option.blocked {
    background: #252525;
    opacity: 0.45;
    cursor: not-allowed;
}

.enchant-option.blocked:hover {
    background: #252525;
}

.enchant-option.blocked .enchant-label {
    cursor: not-allowed;
}

.enchant-option.blocked input,
.enchant-option.blocked select {
    cursor: not-allowed;
}

.blocked-reason {
    display: block;
    min-height: 16px;
    margin-top: 4px;
    color: #ffb3b3;
    font-size: 12px;
    font-weight: normal;
    visibility: hidden;
}

.warning-box {
    background: #4a1f1f;
    color: #ffb3b3;
    border: 1px solid #ff7777;
    border-radius: 6px;
    padding: 10px;
    margin: 12px 0;
    line-height: 1.5;
    text-align: left;
}


/* =========================
   Bücher-Vorschau
========================= */

.book-preview {
    margin-top: 15px;
    background: #242424;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px;
    text-align: left;
}

.book-preview h3 {
    margin: 0 0 10px 0;
    color: #d7b56d;
}

.empty-books {
    color: #aaa;
    margin: 0;
}

.book-list {
    display: grid;
    gap: 8px;
}

.book-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: #333;
    border-radius: 6px;
    padding: 8px 10px;
}

.book-item span {
    color: #aaa;
}

.book-item strong {
    color: #fff2b3;
    text-align: right;
}

.book-item-with-icon {
    min-height: 52px;
}

.book-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.book-preview-icon {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex-shrink: 0;
}


/* =========================
   Ergebnisbereich
========================= */

#output {
    margin-top: 12px;
    line-height: 1.6;
    text-align: left;
    background: #222222;
    padding: 16px;
    border-radius: 10px;
    min-height: 40px;
    max-width: 100%;
    border: 1px solid #3d3d3d;
}

.result-section {
    margin-bottom: 18px;
}

.result-section:last-child {
    margin-bottom: 0;
}

.result-title {
    font-size: 15px;
    font-weight: bold;
    color: #d7b56d;
    margin-bottom: 8px;
}

.result-item-name {
    font-size: 20px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 6px;
}

.result-enchant-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.result-enchant-tag {
    background: #2f2f2f;
    border: 1px solid #4a4a4a;
    color: #f2f2f2;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1.2;
}

.result-success {
    background: #1f4a2b;
    border: 1px solid #2e8b57;
    color: #cfffda;
    border-radius: 8px;
    padding: 12px 14px;
    margin: 10px 0;
    font-size: 1rem;
    font-weight: bold;
}

.result-error {
    background: #4a1f1f;
    border: 1px solid #ff7777;
    color: #ffd2d2;
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: bold;
}


/* =========================
   Rechtliche Inhalte
========================= */

.legal-content {
    color: #d8d8d8;
    font-size: 15px;
    line-height: 1.8;
}

.legal-content p {
    margin: 0 0 18px 0;
}

.legal-content h2 {
    margin: 28px 0 10px 0;
    color: #ffd54a;
    font-size: 1.2rem;
}

.legal-content h3 {
    margin: 24px 0 8px 0;
    color: #fff2b3;
    font-size: 1rem;
}

.legal-content a {
    color: #7ecbff;
    text-decoration: none;
    font-weight: 700;
}

.legal-content a:hover {
    color: #b8e6ff;
    text-decoration: underline;
}

.legal-content ul {
    margin: 10px 0 18px 22px;
    padding: 0;
}

.legal-content li {
    margin-bottom: 8px;
}


/* =========================
   Ergebnis-Kopfkarte
========================= */

.result-hero-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: center;
    background: linear-gradient(180deg, #262626, #202020);
    border: 1px solid #444;
    border-radius: 12px;
    padding: 12px;
}

.result-hero-icon-wrap {
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #181818;
    border: 1px solid #333;
    border-radius: 12px;
    flex-shrink: 0;
}

.result-hero-icon {
    width: 66px;
    height: 66px;
    object-fit: contain;
}

.result-hero-content {
    min-width: 0;
}

.result-hero-content .result-title {
    margin-bottom: 4px;
}

.result-hero-small-title {
    margin-top: 10px;
    font-size: 13px;
}

.result-hero-enchants {
    margin-top: 6px;
}


/* =========================
   Buttons
========================= */

.result-actions {
    margin-bottom: 16px;
}

.secondary-button {
    width: 100%;
    display: block;
    margin: 0 0 16px 0;
    padding: 13px 16px;
    background: linear-gradient(180deg, #363636, #2b2b2b);
    border: 1px solid #555;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

.secondary-button:hover {
    background: linear-gradient(180deg, #444, #333);
    border-color: #666;
}

a.secondary-button {
    text-decoration: none;
}


/* =========================
   Strategie-Anzeige
========================= */

.strategy-box {
    margin: 10px 0 14px;
    background: linear-gradient(180deg, #1f4a2b, #193d24);
    border: 1px solid #2e8b57;
    color: #d7ffd7;
    border-radius: 10px;
    padding: 10px 14px;
    line-height: 1.5;
    box-shadow: 0 0 0 1px rgba(46, 139, 87, 0.15);
}

.strategy-box strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.strategy-box span {
    color: #d5dfd5;
    font-size: 13px;
}

.strategy-box-compact strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.strategy-box-compact span {
    display: block;
    font-size: 0.8rem;
    opacity: 0.9;
    line-height: 1.35;
}

.strategy-comparison {
    margin-top: 12px;
    background: #242424;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 12px;
}

.strategy-comparison strong {
    display: block;
    margin-bottom: 10px;
}

.strategy-list {
    display: grid;
    gap: 10px;
}

.strategy-item {
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: 8px;
}

.strategy-item span {
    font-weight: bold;
    font-size: 15px;
}

.strategy-item small {
    color: #d0d0d0;
    font-size: 12px;
    line-height: 1.4;
}

.strategy-good {
    background: #1f4a2b;
    border: 1px solid #2e8b57;
}

.strategy-danger {
    background: #4a1f1f;
    border: 1px solid #ff7777;
}


/* =========================
   Amboss-Schritte
========================= */

.anvil-steps {
    display: grid;
    gap: 16px;
    margin-top: 14px;
}

.anvil-step {
    background: #2b2b2b;
    border: 1px solid #454545;
    border-radius: 10px;
    padding: 16px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.anvil-step:hover {
    background: #2f2f2f;
    border-color: #555;
}

.step-title {
    font-weight: bold;
    font-size: 16px;
    color: #d7b56d;
    margin-bottom: 14px;
}

.step-row {
    display: grid;
    grid-template-columns:
        minmax(190px, 1fr)
        24px
        minmax(190px, 1fr)
        24px
        minmax(230px, 1.2fr);
    gap: 14px;
    align-items: stretch;
}

.step-plus,
.step-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 22px;
    color: #cfcfcf;
    text-align: center;
}


/* =========================
   Karten-Design der Schritte
========================= */

.step-box {
    background: #1f1f1f;
    border-radius: 12px;
    padding: 14px;
    min-height: 170px;
    border: 1px solid #333;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.step-box.result {
    border: 1px solid #2e8b57;
    background: #1e2a22;
}

.step-box.enchanted-item {
    background: linear-gradient(180deg, #202033, #1e2a22);
    border-color: #5574d8;
    box-shadow:
        inset 0 0 16px rgba(127, 92, 255, 0.10),
        0 0 10px rgba(95, 124, 255, 0.08);
}

.step-box.result.enchanted-item {
    background: linear-gradient(180deg, #20283a, #1d3428);
    border-color: #5f8ee8;
    box-shadow:
        inset 0 0 18px rgba(127, 92, 255, 0.13),
        0 0 12px rgba(95, 124, 255, 0.11);
}

.step-box-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    gap: 8px;
}

.step-object-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex-shrink: 0;
    image-rendering: auto;
}

.step-box-text {
    min-width: 0;
    width: 100%;
    flex: 1;
}

.step-box-text strong {
    display: block;
    color: #ffffff;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 800;
    word-break: normal;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.step-box-text small {
    display: block;
    margin-top: 8px;
    color: #f0f0f0;
    font-size: 12px;
    line-height: 1.35;
    word-break: normal;
    overflow-wrap: anywhere;
}


/* =========================
   Icons allgemein
========================= */

.inline-icon {
    display: inline-block;
    object-fit: contain;
    vertical-align: middle;
    flex-shrink: 0;
}

.section-icon {
    width: 22px;
    height: 22px;
    filter: brightness(1.25) contrast(1.1);
}

.step-title-icon {
    width: 20px;
    height: 20px;
    filter: brightness(1.25) contrast(1.1);
}

.cost-icon {
    width: 22px;
    height: 22px;
}

.result-title-with-icon,
.step-title-with-icon {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-title-with-icon {
    align-items: center;
}


/* =========================
   Kosten-Anzeige
========================= */

.step-cost {
    margin-top: 14px;
    padding: 11px;
    min-height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: bold;
    text-align: center;
    font-size: 15px;
    letter-spacing: 0.1px;
}

.cost-good {
    background: linear-gradient(180deg, #1f5a32, #174626);
    color: #9dffb0;
    border: 1px solid #2e8b57;
}

.cost-warning {
    background: linear-gradient(180deg, #4a3d1f, #3b3018);
    color: #ffe08a;
    border: 1px solid #c9a227;
}

.cost-danger {
    background: linear-gradient(180deg, #4a1f1f, #3a1818);
    color: #ffb3b3;
    border: 1px solid #ff7777;
}


/* =========================
   Zusammenfassung
========================= */

.anvil-summary {
    margin-top: 18px;
    padding: 14px;
    border-radius: 10px;
    line-height: 1.7;
    text-align: left;
    font-size: 15px;
}

.summary-good {
    background: linear-gradient(180deg, #1f4a2b, #193d24);
    border: 1px solid #2e8b57;
    color: #d7ffd7;
}

.summary-danger {
    background: linear-gradient(180deg, #4a1f1f, #3a1919);
    border: 1px solid #ff7777;
    color: #ffcccc;
}


/* =========================
   Footer
========================= */

.site-footer {
    max-width: 900px;
    margin: 28px auto 0;
    padding: 18px 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: #aaa;
    font-size: 14px;
}

.site-footer a {
    color: #d7b56d;
    text-decoration: none;
    font-weight: 700;
}

.site-footer a:hover {
    color: #fff2b3;
    text-decoration: underline;
}

.site-footer span {
    color: #666;
}


/* =========================
   Mobile Ansicht
========================= */

@media (max-width: 1000px) {
    .container {
        max-width: 900px;
    }

    .step-row {
        grid-template-columns:
            minmax(170px, 1fr)
            22px
            minmax(170px, 1fr)
            22px
            minmax(200px, 1.15fr);
    }

    .step-box {
        min-height: 160px;
        padding: 12px;
    }

    .step-object-icon {
        width: 56px;
        height: 56px;
    }

    .step-box-text strong {
        font-size: 15px;
    }
}

@media (max-width: 900px) {
    .app-header {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 24px;
        padding: 0 16px;
    }

    .app-header h1 {
        grid-column: 1;
        white-space: normal;
        font-size: 1.6rem;
    }

    .language-switcher {
        grid-column: 1;
        justify-self: center;
    }

    .container {
        max-width: 760px;
    }

    .result-hero-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .result-hero-icon-wrap {
        margin: 0 auto;
    }

    .result-hero-enchants {
        justify-content: center;
    }

    .step-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .step-plus,
    .step-arrow {
        min-height: 20px;
    }
}

@media (max-width: 700px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
        max-width: 100%;
    }

    .enchant-option {
        flex-direction: column;
        align-items: stretch;
    }

    .level-select {
        width: 100%;
    }

    .book-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .book-item strong {
        text-align: left;
    }

    .step-box {
        min-height: auto;
    }

    .step-object-icon {
        width: 58px;
        height: 58px;
    }

    .result-enchant-list {
        gap: 6px;
    }

    .result-hero-icon-wrap {
        width: 84px;
        height: 84px;
    }

    .result-hero-icon {
        width: 66px;
        height: 66px;
    }

    .app-header h1 {
        font-size: 1.4rem;
    }
}