﻿:root {
    --k-bg: #151219;
    --k-bg-soft: rgba(21,18,25,.9);
    --k-gold: #d8b978;
    --k-gold-light: #f1dfb1;
    --k-text: #f5f1e8;
    --k-muted: #b8adb9;
    --k-danger: #ff7b7b;
    --k-ok: #8fd6a5
}

.k-page {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    padding: 1rem;
    background: url('/Rhinedottir1.jpg') center/cover fixed
}

    .k-page:before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg,rgba(10,8,13,.25),rgba(10,8,13,.78)),rgba(0,0,0,.18);
        z-index: -1
    }

.k-content {
    width: min(100%,1400px);
    margin: auto
}

.k-panel, .team-card {
    background: var(--k-bg-soft);
    color: var(--k-text);
    border: 1px solid rgba(216,185,120,.32);
    border-radius: 1.15rem;
    box-shadow: 0 18px 50px rgba(0,0,0,.35);
    backdrop-filter: blur(12px)
}

.main-panel {
    padding: 1.25rem
}

.team-title {
    color: var(--k-gold-light);
    font-weight: 700
}

.team-subtitle, .muted {
    color: var(--k-muted)
}

.builder-form {
    display: grid;
    grid-template-columns: minmax(180px,260px) minmax(240px,1fr) auto;
    gap: .75rem;
    align-items: end;
    margin-top: 1.1rem
}

.field-label {
    display: block;
    color: var(--k-gold-light);
    font-weight: 700;
    margin-bottom: .4rem
}

.team-input {
    width: 100%;
    padding: .85rem 1rem;
    background: rgba(21,18,25,.96);
    color: var(--k-text);
    border: 1px solid rgba(216,185,120,.32);
    border-radius: .9rem;
    outline: none
}

    .team-input:focus {
        border-color: var(--k-gold);
        box-shadow: 0 0 0 2px rgba(216,185,120,.12)
    }

select.team-input option {
    background: #151219;
    color: var(--k-text)
}

.search-btn {
    padding: .85rem 1.2rem;
    border: 1px solid var(--k-gold);
    border-radius: .9rem;
    background: var(--k-gold);
    color: #1a151b;
    font-weight: 800
}

.info-box, .error-box {
    margin-top: 1rem;
    padding: .9rem 1rem;
    border-radius: .9rem;
    background: rgba(216,185,120,.08);
    border: 1px solid rgba(216,185,120,.2);
    color: var(--k-muted)
}

.error-box {
    border-color: rgba(255,123,123,.45);
    color: #ffd0d0
}

.result-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    margin: 1.25rem 0 .8rem
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 1rem
}

.team-card {
    padding: 1rem
}

    .team-card.complete {
        border-color: rgba(143,214,165,.48)
    }

    .team-card.missing {
        border-color: rgba(255,123,123,.38)
    }

.team-name {
    color: var(--k-gold-light);
    font-weight: 800;
    font-size: 1.05rem
}

.availability {
    font-size: .82rem;
    margin: .25rem 0 .8rem;
    color: var(--k-muted)
}

    .availability.ok {
        color: var(--k-ok)
    }

    .availability.bad {
        color: var(--k-danger)
    }

.members {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: .55rem
}

.member {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .55rem;
    border-radius: .75rem;
    border: 1px solid rgba(216,185,120,.16);
    background: rgba(216,185,120,.06)
}

    .member.missing {
        border-color: rgba(255,123,123,.42);
        background: rgba(255,123,123,.08)
    }

.avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 10px;
    object-fit: cover;
    background: rgba(216,185,120,.1)
}

.member-name {
    font-size: .88rem;
    font-weight: 700;
    min-width: 0
}

.member-state {
    font-size: .72rem;
    color: var(--k-ok)
}

.member.missing .member-state {
    color: var(--k-danger)
}

.team-card {
    cursor: pointer
}

    .team-card:hover {
        transform: translateY(-2px);
        transition: .15s ease
    }

.detail-btn {
    all: unset;
    display: block;
    width: 100%;
    cursor: pointer
}

.build-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(5,4,7,.82)
}

    .build-modal.open {
        display: flex
    }

.build-dialog {
    width: min(1100px,100%);
    max-height: 90vh;
    overflow: auto;
    padding: 1.15rem;
    background: #17141b;
    border: 1px solid rgba(216,185,120,.45);
    border-radius: 1.1rem;
    color: var(--k-text)
}

.build-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem
}

.close-build {
    border: 1px solid rgba(216,185,120,.4);
    background: transparent;
    color: var(--k-text);
    border-radius: .65rem;
    padding: .45rem .7rem
}

.build-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: .8rem
}

.build-char {
    padding: 1rem;
    border: 1px solid rgba(216,185,120,.22);
    border-radius: .9rem;
    background: rgba(216,185,120,.05)
}

    .build-char h3 {
        color: var(--k-gold-light);
        font-size: 1.05rem
    }

.build-row {
    margin: .55rem 0
}

.build-label {
    display: block;
    color: var(--k-gold);
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em
}

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .35rem
}

.stat {
    padding: .28rem .48rem;
    border-radius: .5rem;
    background: rgba(255,255,255,.06);
    font-size: .8rem
}

.roster-box {
    margin-top: 1rem;
    border: 1px solid rgba(216,185,120,.24);
    border-radius: .9rem;
    background: rgba(216,185,120,.05);
    overflow: hidden
}

.roster-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    border: 0;
    background: transparent;
    color: var(--k-gold-light);
    font-weight: 800;
    cursor: pointer;
    user-select: none;
    list-style: none
}

    .roster-toggle::-webkit-details-marker {
        display: none
    }

    .roster-toggle::marker {
        content: ""
    }

    .roster-toggle::after {
        content: "▼";
        flex-shrink: 0;
        font-size: .8rem;
        transition: transform .2s ease
    }

.roster-box[open] .roster-toggle::after {
    transform: rotate(180deg)
}

.roster-body {
    display: block;
    padding: 0 1rem 1rem
}

.roster-tools {
    display: flex;
    gap: .6rem;
    margin-bottom: .75rem
}

.roster-search {
    flex: 1
}

.roster-grid {
    display: grid;
    grid-template-columns: repeat(6,minmax(0,1fr));
    gap: .5rem;
    max-height: 360px;
    overflow: auto
}

.roster-char {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem;
    border: 1px solid rgba(216,185,120,.15);
    border-radius: .65rem;
    background: rgba(255,255,255,.025);
    cursor: pointer
}

    /* Ausgewählter Charakter */
    .roster-char.selected {
        border-color: rgba(126, 231, 135, .75);
        background: rgba(126, 231, 135, .18);
        box-shadow: inset 0 0 0 1px rgba(126, 231, 135, .18);
    }

        .roster-char.selected span {
            color: #9af0a2;
            font-weight: 700;
        }

    /* Checkbox ebenfalls grün */
    .roster-char input[type="checkbox"] {
        accent-color: #7ee787;
    }

/* Pfeil oben rechts entfernen */
.roster-toggle::after {
    display: none !important;
}

/* Falls das Info-Zeichen über ::before erzeugt wird */
.roster-toggle::before {
    display: none !important;
}

.roster-char.showcase {
    box-shadow: inset 0 0 0 1px rgba(216,185,120,.35)
}

.roster-char img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover
}

.roster-char span {
    font-size: .78rem;
    overflow: hidden;
    text-overflow: ellipsis
}

.roster-note {
    font-size: .78rem;
    color: var(--k-muted);
    margin-bottom: .7rem
}

@media(max-width:991px) {
    .roster-grid {
        grid-template-columns: repeat(4,minmax(0,1fr))
    }

    .teams-grid {
        grid-template-columns: repeat(2,minmax(0,1fr))
    }

    .builder-form {
        grid-template-columns: 1fr 1fr
    }

    .search-btn {
        grid-column: 1/-1
    }
}

@media(max-width:575px) {
    .roster-grid {
        grid-template-columns: repeat(2,minmax(0,1fr))
    }

    .k-page {
        padding: .75rem;
        background-attachment: scroll
    }

    .teams-grid, .builder-form, .build-grid {
        grid-template-columns: 1fr
    }

    .members {
        grid-template-columns: 1fr
    }

    .search-btn {
        grid-column: auto
    }
}

/* ============================================================
   DPS Checker im Build-Modal
   ============================================================ */
.dps-summary {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-top: .45rem;
}

.sim-char-missing {
    opacity: .72;
    border-style: dashed;
}

.sim-source.manual {
    background: rgba(216,185,120,.12);
    color: var(--k-gold-light);
}

.dps-stat span {
    display: block;
    color: var(--k-muted);
    font-size: .65rem;
}

.dps-empty {
    margin-top: .55rem;
    padding: .75rem;
    border-radius: .65rem;
    background: rgba(255,255,255,.035);
    color: var(--k-muted);
}

@media (max-width: 991px) {
}

@media (max-width: 575px) {
    .dps-summary {
        display: block;
    }
}

/* Team status + F2P/P2P badge */
.team-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem;
    margin: .25rem 0 .8rem;
}

    .team-meta .availability {
        margin: 0;
    }

.investment-badge {
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    padding: .24rem .48rem;
    border-radius: 999px;
    border: 1px solid rgba(216,185,120,.2);
    background: rgba(255,255,255,.05);
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.2;
}

    .investment-badge.f2p {
        border-color: rgba(126,231,135,.45);
        background: rgba(126,231,135,.12);
        color: #9af0a2;
    }

    .investment-badge.p2p {
        border-color: rgba(255,107,107,.45);
        background: rgba(255,107,107,.12);
        color: #ff8d8d;
    }

/* Team-Ranking: rechts neben dem Namen */
.team-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

    .team-heading .team-name {
        min-width: 0;
    }

.team-tier {
    flex-shrink: 0;
    min-width: 48px;
    padding: 5px 10px;
    border-radius: 9px;
    text-align: center;
    font-weight: 900;
    font-size: 0.92rem;
    border: 1px solid currentColor;
    background: rgba(0,0,0,.28);
}

    .team-tier.tier-sss {
        color: #f6d38c;
        box-shadow: 0 0 12px rgba(246,211,140,.18);
    }

    .team-tier.tier-ss {
        color: #e2baff;
    }

    .team-tier.tier-s {
        color: #a9e8d0;
    }

    .team-tier.tier-a {
        color: #a5c7ff;
    }

    .team-tier.tier-b {
        color: #c3bdc8;
    }

/* Build-Fenster: Charakter-, Artefakt- und Waffenbilder */
.build-character-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

    .build-character-head h3 {
        margin: 0;
    }

.build-character-icon {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(216,185,120,.45);
    background: rgba(255,255,255,.06);
}

.build-item-with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.build-item-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(216,185,120,.2);
}


/* ============================================================
   Roster-Auswahl: finale Overrides
   ============================================================ */
.roster-char:has(input[type="checkbox"]:checked) {
    border-color: rgba(126,231,135,.85) !important;
    background: rgba(126,231,135,.20) !important;
    box-shadow: inset 0 0 0 1px rgba(126,231,135,.20) !important;
}

    .roster-char:has(input[type="checkbox"]:checked) span {
        color: #9af0a2 !important;
        font-weight: 700;
    }

.roster-char input[type="checkbox"] {
    accent-color: #7ee787;
}

.roster-toggle::before,
.roster-toggle::after {
    content: none !important;
    display: none !important;
}
