/* ============================================================
   无双深渊 — 官方深色主题
   配色取自官网 (gamecity 无双深渊)：墨绿黑底 / 象牙 / 酒红 / 暗金
   标题使用明朝体衬线 (Noto Serif SC)
   ============================================================ */

:root {
    --ground: #001920;
    --ground-2: #04222b;
    --panel: #0c2429;
    --panel-2: #0e2c34;
    --panel-3: #123640;

    --ivory: #f5efcc;
    --mist: #ccd2d2;
    --mist-dim: #7f9498;

    --wine: #810b2c;
    --blood: #c2211c;
    --crimson: #d81248;
    --gold: #84741a;
    --gold-line: #a48a2e;
    --gold-bright: #c9b458;

    --good: #33b562;
    --danger: #e0474b;

    --hairline: rgba(245, 239, 204, 0.14);
    --hairline-strong: rgba(245, 239, 204, 0.28);

    --serif: "Noto Serif SC", "Songti SC", "STSong", "Source Han Serif SC", "SimSun", serif;
    --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --radius: 8px;
    --shadow-card: 0 18px 40px -30px rgba(0, 0, 0, 0.9);
    --shadow-lift: 0 22px 48px -24px rgba(0, 0, 0, 0.9), 0 0 26px -10px rgba(216, 18, 72, 0.55);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--sans);
    color: var(--mist);
    background:
        radial-gradient(1100px 620px at 78% -8%, rgba(129, 11, 44, 0.30), transparent 62%),
        radial-gradient(900px 520px at 8% 6%, rgba(12, 44, 52, 0.9), transparent 60%),
        linear-gradient(180deg, var(--ground-2), var(--ground) 42%);
    background-attachment: fixed;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

::selection {
    background: rgba(216, 18, 72, 0.35);
    color: var(--ivory);
}

/* ---------------- Header ---------------- */
header {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem clamp(1rem, 4vw, 3rem);
    background: linear-gradient(180deg, rgba(4, 24, 30, 0.94), rgba(4, 24, 30, 0.55));
    border-bottom: 1px solid var(--hairline);
    box-shadow: 0 1px 0 rgba(164, 138, 46, 0.18), 0 18px 40px -28px rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(6px);
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 0.85rem;
    flex-wrap: wrap;
}

header h1 {
    font-family: var(--serif);
    font-weight: 900;
    font-size: clamp(1.35rem, 2.6vw, 1.9rem);
    letter-spacing: 0.22em;
    color: var(--ivory);
    text-shadow: 0 0 18px rgba(216, 18, 72, 0.35);
}

.brand .tagline {
    font-family: var(--serif);
    font-size: 0.72rem;
    letter-spacing: 0.42em;
    color: var(--gold-bright);
    opacity: 0.75;
}

nav {
    display: flex;
    gap: 0.4rem;
}

nav a {
    font-family: var(--serif);
    text-decoration: none;
    color: var(--mist);
    font-size: 0.95rem;
    letter-spacing: 0.14em;
    padding: 0.5rem 1.05rem;
    border-radius: 3px;
    border: 1px solid transparent;
    transition: color .2s, border-color .2s, background .2s;
}

nav a:hover,
nav a.active {
    color: var(--ivory);
    background: linear-gradient(180deg, rgba(129, 11, 44, 0.55), rgba(129, 11, 44, 0.2));
    border-color: var(--wine);
    box-shadow: 0 0 16px -4px rgba(216, 18, 72, 0.55), inset 0 0 0 1px rgba(201, 180, 88, 0.25);
}

/* ---------------- Layout ---------------- */
main {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
}

.page-title {
    font-family: var(--serif);
    font-weight: 700;
    color: var(--ivory);
    letter-spacing: 0.18em;
    font-size: 1.5rem;
    margin-bottom: 1.4rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--hairline);
    background:
        linear-gradient(90deg, var(--gold-line), transparent) bottom left / 40% 1px no-repeat;
}

/* ---------------- Filters ---------------- */
.filters-container {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.75rem;
    box-shadow: inset 0 1px 0 rgba(245, 239, 204, 0.05), var(--shadow-card);
}

.filters-row {
    display: flex;
    gap: 0.7rem;
    margin-bottom: 0.7rem;
    flex-wrap: wrap;
    align-items: center;
}

.filters-row:last-child {
    margin-bottom: 0;
}

.filters-container input,
.filters-container select {
    font-family: var(--sans);
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    color: var(--ivory);
    background: rgba(0, 12, 16, 0.55);
    border: 1px solid var(--hairline);
    border-radius: 4px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.filters-container input {
    flex: 1;
    min-width: 160px;
}

.filters-container select {
    min-width: 104px;
    cursor: pointer;
}

.filters-container input::placeholder {
    color: var(--mist-dim);
}

.filters-container option {
    background: var(--panel);
    color: var(--ivory);
}

.filters-container input:focus,
.filters-container select:focus {
    border-color: var(--gold-line);
    box-shadow: 0 0 0 1px rgba(164, 138, 46, 0.4), 0 0 14px -4px rgba(201, 180, 88, 0.5);
}

.result-count {
    margin-left: auto;
    font-family: var(--serif);
    color: var(--gold-bright);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
}

/* ---------------- Character grid & cards ---------------- */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 1.1rem;
}

.character-card {
    position: relative;
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 1.05rem 1.05rem 1.15rem;
    cursor: pointer;
    overflow: hidden;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.character-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, rgba(201, 180, 88, 0.55), transparent 60%);
    border-top-left-radius: var(--radius);
    pointer-events: none;
}

.character-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--crimson), var(--wine));
    opacity: 0;
    transition: opacity .22s ease;
}

.character-card:hover {
    transform: translateY(-4px);
    border-color: var(--hairline-strong);
    box-shadow: var(--shadow-lift);
}

.character-card:hover::after {
    opacity: 1;
}

.character-card h3 {
    font-family: var(--serif);
    font-weight: 700;
    color: var(--ivory);
    font-size: 1.18rem;
    letter-spacing: 0.06em;
    line-height: 1.25;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.card-header h3 {
    margin: 0;
}

.variant-badge {
    flex-shrink: 0;
    display: inline-block;
    font-family: var(--sans);
    padding: 0.2rem 0.45rem;
    border-radius: 3px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--ground);
    text-transform: uppercase;
}

.variant-alternative { background: #b98ce0; }
.variant-origins { background: var(--gold-bright); }
.variant-adult { background: #7fcaa0; }

/* ---------------- Seals ---------------- */
.seals {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.seals-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.seals-group h4 {
    font-family: var(--serif);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: var(--mist-dim);
    margin-bottom: 0.5rem;
}

.seal-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.seal {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 1px 3px rgba(0, 0, 0, 0.4);
}

.seal.awakened {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), 0 0 8px rgba(201, 180, 88, 0.75);
    outline: 1px solid var(--gold-bright);
}

/* attribute (functional) colors — tuned for dark ground */
.seal-力 { background: #e0474b; }
.seal-技 { background: #4b8ef0; }
.seal-坚 { background: #d6a91f; }
.seal-速 { background: #33b562; }
.seal-知 { background: #7c7ff0; }
.seal-魅 { background: #ec5ba0; }
.seal-炎 { background: #f2792b; }
.seal-冰 { background: #29b6d4; }
.seal-斩 { background: #a86bd6; }
.seal-风 { background: #2ec4b0; }
.seal-雷 { background: #d6a91f; }
.seal-special {
    background: rgba(245, 239, 204, 0.08);
    color: var(--mist);
    box-shadow: inset 0 0 0 1px var(--hairline-strong);
}

.awakened-seals {
    margin-top: 0.75rem;
    padding-top: 0.7rem;
    border-top: 1px dashed rgba(201, 180, 88, 0.3);
}

.awakened-label {
    display: block;
    margin-bottom: 0.4rem;
    font-family: var(--serif);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    color: var(--gold-bright);
}

.awakened-label::before {
    content: "◆ ";
    opacity: 0.7;
}

.summon-skill {
    margin-top: 0.85rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--hairline);
    font-size: 0.82rem;
    color: var(--mist);
}

/* ---------------- Character Detail ---------------- */
.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1.25rem;
    align-items: start;
}

.character-detail {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-card);
}

.back-btn {
    background: none;
    border: 1px solid var(--hairline);
    color: var(--gold-bright);
    cursor: pointer;
    font-family: var(--serif);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
    margin-bottom: 1.25rem;
    transition: color .2s, border-color .2s, background .2s;
}

.back-btn:hover {
    color: var(--ivory);
    border-color: var(--gold-line);
    background: rgba(164, 138, 46, 0.12);
}

.character-detail h2 {
    font-family: var(--serif);
    font-weight: 900;
    color: var(--ivory);
    font-size: 1.9rem;
    letter-spacing: 0.1em;
    margin: 0.5rem 0 1.5rem;
    text-shadow: 0 0 18px rgba(216, 18, 72, 0.3);
}

.section {
    margin: 1.25rem 0;
    padding: 1.25rem;
    background: rgba(0, 12, 16, 0.4);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
}

.section h3 {
    font-family: var(--serif);
    font-weight: 700;
    color: var(--gold-bright);
    letter-spacing: 0.14em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--hairline);
}

.section p {
    color: var(--mist);
    margin: 0.35rem 0;
}

.section p strong {
    color: var(--ivory);
}

.effect {
    margin: 0.6rem 0;
    padding: 0.85rem;
    background: rgba(14, 44, 52, 0.6);
    border-radius: 6px;
    border-left: 3px solid var(--crimson);
}

.effect-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.effect-type {
    display: inline-block;
    background: rgba(129, 11, 44, 0.45);
    color: var(--ivory);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    box-shadow: inset 0 0 0 1px rgba(216, 18, 72, 0.35);
}

.awakened-badge {
    display: inline-block;
    background: rgba(201, 180, 88, 0.15);
    color: var(--gold-bright);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    box-shadow: inset 0 0 0 1px rgba(201, 180, 88, 0.4);
}

.effect-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.effect-base,
.effect-awakened {
    padding: 0.6rem 0.75rem;
    border-radius: 4px;
}

.effect-base {
    background: rgba(0, 12, 16, 0.4);
}

.effect-awakened {
    background: rgba(132, 116, 26, 0.12);
    border-left: 2px solid var(--gold-line);
}

.effect-label {
    display: block;
    margin-bottom: 0.25rem;
    font-family: var(--serif);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--mist-dim);
}

.effect-awakened .effect-label {
    color: var(--gold-bright);
}

.conditions,
.condition {
    color: var(--mist-dim);
    font-size: 0.78rem;
    margin-top: 0.25rem;
}

/* 词条特性 (基础特性 / 武器特性) */
.trait-lines {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.trait-lines li {
    position: relative;
    padding-left: 1.1rem;
    color: var(--mist);
    line-height: 1.55;
}

.trait-lines li::before {
    content: "◆";
    position: absolute;
    left: 0;
    top: 0.05em;
    font-size: 0.62rem;
    color: var(--gold-line);
}

.effect-awakened .trait-lines li::before {
    color: var(--gold-bright);
}

/* 相关角色（详情页右侧竖向侧栏） */
.related-sidebar {
    position: sticky;
    top: 1rem;
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
}

.related-sidebar > h3 {
    font-family: var(--serif);
    font-weight: 700;
    color: var(--gold-bright);
    letter-spacing: 0.14em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--hairline);
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.related-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.related-item .character-card {
    padding: 0.85rem;
}

.related-item .character-card h3 {
    font-size: 1.02rem;
}

.related-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding-left: 0.15rem;
}

.related-tag {
    background: rgba(201, 180, 88, 0.12);
    color: var(--gold-bright);
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    box-shadow: inset 0 0 0 1px rgba(201, 180, 88, 0.35);
}

.related-loading {
    color: var(--mist-dim);
    padding: 0.5rem 0;
}

/* ---------------- Team Builder ---------------- */
.team-builder {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}

.team-slots {
    margin-bottom: 2rem;
}

.slot-group {
    margin-bottom: 1.5rem;
}

.slot-group h3 {
    font-family: var(--serif);
    font-weight: 700;
    color: var(--gold-bright);
    letter-spacing: 0.14em;
    margin-bottom: 1rem;
}

.slot-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.team-slot {
    position: relative;
    border: 2px dashed var(--hairline-strong);
    border-radius: var(--radius);
    padding: 1rem;
    min-width: 150px;
    min-height: 100px;
    cursor: pointer;
    background: rgba(0, 12, 16, 0.35);
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.team-slot:hover {
    border-color: var(--gold-line);
    box-shadow: 0 0 18px -6px rgba(201, 180, 88, 0.55);
    transform: translateY(-2px);
}

.main-slot {
    border-color: var(--wine);
    border-style: solid;
    background: linear-gradient(180deg, rgba(129, 11, 44, 0.28), rgba(0, 12, 16, 0.35));
}

.companion-slot {
    border-color: rgba(75, 142, 240, 0.55);
    border-style: solid;
    background: linear-gradient(180deg, rgba(75, 142, 240, 0.14), rgba(0, 12, 16, 0.35));
}

.summon-slot {
    border-color: var(--hairline-strong);
}

.slot-label {
    display: block;
    font-family: var(--serif);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: var(--mist-dim);
    margin-bottom: 0.5rem;
}

.slot-empty {
    color: var(--mist-dim);
    font-size: 1.5rem;
    font-family: var(--serif);
}

.char-name {
    font-family: var(--serif);
    font-weight: 700;
    color: var(--ivory);
    display: block;
    margin-bottom: 0.5rem;
}

.char-seals {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--blood);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    box-shadow: 0 0 10px -2px rgba(216, 18, 72, 0.7);
    transition: transform .15s;
}

.remove-btn:hover {
    transform: scale(1.1);
}

/* ---------------- Synergy Result ---------------- */
.synergy-result {
    background: rgba(0, 12, 16, 0.4);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.synergy-result:empty {
    display: none;
}

.synergy-result h3 {
    font-family: var(--serif);
    font-weight: 700;
    color: var(--ivory);
    letter-spacing: 0.14em;
    margin-bottom: 1.25rem;
}

.synergy-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-family: var(--serif);
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--gold-bright);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 18px rgba(201, 180, 88, 0.35);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--mist-dim);
    letter-spacing: 0.05em;
}

.seal-distribution {
    margin-bottom: 1.5rem;
}

.seal-distribution h4,
.character-synergies h4 {
    font-family: var(--serif);
    color: var(--gold-bright);
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}

.seal-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.seal-count {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--mist);
    font-variant-numeric: tabular-nums;
}

.synergy-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.6rem 0.85rem;
    background: rgba(14, 44, 52, 0.6);
    border: 1px solid var(--hairline);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.role-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-family: var(--serif);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #fff;
}

.role-badge.main { background: var(--wine); }
.role-badge.companion { background: #2f66b3; }
.role-badge.summon { background: rgba(245, 239, 204, 0.12); color: var(--mist); }

.synergy-item .char-name {
    margin: 0;
}

.bonus {
    color: var(--mist-dim);
    font-variant-numeric: tabular-nums;
}

.bonus.positive {
    color: var(--good);
    font-weight: 700;
}

.effects-count {
    color: var(--mist-dim);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.tag {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.tag-green {
    background: rgba(51, 181, 98, 0.16);
    color: var(--good);
    box-shadow: inset 0 0 0 1px rgba(51, 181, 98, 0.4);
}

/* ---------------- 模板推荐栏 ---------------- */
.template-bar {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.template-label {
    font-family: var(--serif);
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    color: var(--mist-dim);
}

.template-btn {
    font-family: var(--serif);
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--hairline-strong);
    background: rgba(14, 44, 52, 0.6);
    color: var(--ivory);
    cursor: pointer;
    transition: border-color .2s, background .2s, color .2s;
}

.template-btn:hover {
    border-color: var(--gold-line);
    background: rgba(164, 138, 46, 0.12);
    color: var(--gold-bright);
}

.template-btn:active {
    background: rgba(164, 138, 46, 0.22);
}

.template-clear {
    border-color: rgba(224, 71, 75, 0.35);
    color: var(--danger);
}

template-clear:hover {
    border-color: var(--danger);
    background: rgba(224, 71, 75, 0.12);
}

.template-share {
    border-color: rgba(51, 181, 98, 0.35);
    color: var(--good);
}

.template-share:hover {
    border-color: var(--good);
    background: rgba(51, 181, 98, 0.12);
}

/* Toast notification */
.team-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--hairline-strong);
    color: var(--ivory);
    font-family: var(--serif);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 20px 50px -16px rgba(0,0,0,0.9);
    z-index: 200;
    opacity: 0;
    transition: transform .3s ease, opacity .3s ease;
    pointer-events: none;
}

.team-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ---------------- 协同分析 - 触发效果详情 ---------------- */
.synergy-triggered {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.4rem 0.85rem 0.6rem;
    background: rgba(0, 12, 16, 0.3);
    border-radius: 0 0 6px 6px;
    border-top: 1px solid var(--hairline);
    margin-top: -0.5rem;
    margin-bottom: 0.5rem;
}

.synergy-triggered-name {
    font-size: 0.82rem;
    color: var(--gold-bright);
    line-height: 1.4;
}

.synergy-triggered-cond {
    font-size: 0.75rem;
    color: var(--mist-dim);
    margin-top: 0.1rem;
}

/* ---------------- Modal ---------------- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 8, 12, 0.72);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-content {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--hairline-strong);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 800px;
    max-height: 80vh;
    width: 90%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.95), 0 0 40px -12px rgba(216, 18, 72, 0.4);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-header h3 {
    font-family: var(--serif);
    font-weight: 700;
    color: var(--ivory);
    letter-spacing: 0.14em;
}

.modal-header button {
    background: none;
    border: none;
    color: var(--mist);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: color .2s;
}

.modal-header button:hover {
    color: var(--crimson);
}

#selector-search {
    font-family: var(--sans);
    padding: 0.55rem 1rem;
    color: var(--ivory);
    background: rgba(0, 12, 16, 0.55);
    border: 1px solid var(--hairline);
    border-radius: 4px;
    margin-bottom: 1rem;
    width: 100%;
    outline: none;
}

#selector-search::placeholder {
    color: var(--mist-dim);
}

#selector-search:focus {
    border-color: var(--gold-line);
    box-shadow: 0 0 0 1px rgba(164, 138, 46, 0.4);
}

#selector-list {
    overflow-y: auto;
    flex: 1;
    padding-right: 0.25rem;
}

/* thin themed scrollbar */
#selector-list::-webkit-scrollbar {
    width: 8px;
}

#selector-list::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

.error {
    color: var(--danger);
    text-align: center;
    padding: 1rem;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .related-sidebar {
        position: static;
    }

    .related-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 640px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    nav {
        width: 100%;
    }

    nav a {
        flex: 1;
        text-align: center;
    }

    .synergy-stats {
        gap: 1.25rem;
        justify-content: space-around;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
