/* Sect UI - extracted from inline index.html */


/* The shared design foundation (tokens + component library) now lives in
   css/design-system.css on :root, so any screen resolves it globally.
   This file keeps only sect-specific styles/overrides. */

/* Bloodline Builder Styles */
.palette-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
}

.palette-block:active {
    cursor: grabbing !important;
}

.bloodline-subtab:hover {
    background: rgba(78, 205, 196, 0.4) !important;
}

.bloodline-subtab.active {
    background: rgba(78, 205, 196, 0.5) !important;
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.4);
}

/* (Legacy .sect-action-btn removed — Etapa 13: replaced by .sect-btn variants.) */

/* ========================================
   SECT MEMBERSHIP UI
   ======================================== */
.sm-panel { padding: 12px; display: flex; flex-direction: column; gap: 10px; height: 100%; }

/* Header */
.sm-header { display: flex; justify-content: space-between; align-items: center; }
.sm-header-title { display: flex; flex-direction: column; gap: 2px; }
.sm-sect-name { font-size: 15px; font-weight: 700; color: var(--p-e8d5b7); letter-spacing: 0.5px; }
.sm-rank { font-size: 12px; font-weight: 600; }
.sm-header-stats { display: flex; gap: 12px; }
.sm-stat-box { display: flex; flex-direction: column; align-items: flex-end; }
.sm-stat-label { font-size: 10px; color: var(--p-666666); text-transform: uppercase; letter-spacing: 0.5px; }
.sm-stat-value { font-size: 15px; font-weight: 700; }
.sm-color-accent { color: var(--ui-teal); }
.sm-color-gold { color: var(--ui-gold); }

/* Promotion */
.sm-promotion { padding: 8px 10px; background: rgba(255,255,255,0.03); border-radius: 6px; border-left: 3px solid var(--p-666666); }
.sm-promotion-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.sm-promotion-label { font-size: 11px; color: var(--p-888888); }
.sm-promotion-count { font-size: 10px; color: var(--p-666666); }
.sm-trial-btn { width: 100%; margin-top: 6px; padding: 5px; background: transparent; border: 1px solid; border-radius: 4px; cursor: pointer; font-size: 11px; transition: background 0.2s; }
.sm-trial-btn:hover { background: rgba(255,255,255,0.05); }
.sm-trial-info { display: block; text-align: center; font-size: 10px; color: var(--p-666666); margin-top: 4px; }

/* Progress bar shared */
.sm-progress-track { height: 5px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.sm-progress-lg { height: 8px; border-radius: 4px; }
.sm-progress-fill { height: 100%; border-radius: inherit; transition: width 0.4s ease; }



/* New Sect System v2 Styles */
.sect-overview {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

.sect-resources {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    background: rgba(78, 205, 196, 0.1);
    border: 2px solid var(--ui-teal);
    border-radius: 10px;
}

.resource-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.resource-icon {
    font-size: 1.5em;
}

.resource-value {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--ui-teal);
}

.resource-name {
    font-size: 0.8em;
    color: var(--p-888888);
}

.resource-gen {
    font-size: 0.75em;
    color: var(--ui-success);
}


.sect-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

/* .sect-btn base now defined in the design foundation at the top of this file. */

/* Bulk-buy button animation */
@keyframes bulk-btn-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(0.90); }
    100% { transform: scale(1); }
}
[data-action="sectShopBuyPill"]:active,
[data-action="techSpendBuff"]:active,
[data-action="techRefundBuff"]:active {
    animation: bulk-btn-pop 0.15s ease;
}

/* Sect Modals */
.buildings-modal, .disciples-modal, .recruitment-modal {
    padding: 20px;
}

.buildings-grid, .disciples-list, .candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.building-card, .disciple-card, .candidate-card {
    padding: 15px;
    background: rgba(30, 30, 50, 0.8);
    border: 2px solid var(--ui-teal);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.building-card:hover, .disciple-card:hover, .candidate-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.3);
}

.candidate-card {
    cursor: pointer;
}

.btn-upgrade, .btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
    background: linear-gradient(135deg, var(--ui-teal), var(--ui-teal-2));
    color: var(--p-ffffff);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upgrade:hover, .btn-small:hover {
    background: linear-gradient(135deg, var(--p-5fd4cc), var(--ui-teal));
}

.btn-upgrade.disabled, .btn-small.disabled {
    background: var(--p-444444);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-danger {
    background: linear-gradient(135deg, var(--ui-danger), var(--p-ff4444));
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--p-ff7b7b), var(--p-ff5555));
}

.btn-promote {
    background: linear-gradient(135deg, var(--ui-teal), var(--p-2ecc71));
}

.btn-promote:hover {
    background: linear-gradient(135deg, var(--p-5fd4cc), var(--p-3edc81));
}

.btn-demote {
    background: linear-gradient(135deg, var(--p-f39c12), var(--p-e67e22));
}

.btn-demote:hover {
    background: linear-gradient(135deg, var(--p-f5a623), var(--p-f08532));
}

/* ===== SECT MODALS DETAILED STYLES ===== */

/* Disciples Modal */
.disciples-modal {
    color: var(--p-ffffff);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.disciples-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 0;
    padding: 15px;
    border-radius: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    color: var(--ui-teal);
    font-weight: bold;
}

.filter-group select {
    padding: 8px 12px;
    background: rgba(30, 30, 50, 0.9);
    border: 2px solid var(--ui-teal);
    border-radius: 5px;
    color: var(--p-ffffff);
    font-size: 0.95em;
    cursor: pointer;
}

.filter-group select:hover {
    border-color: var(--ui-gold);
}

.disciples-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px 0;
    grid-template-columns: repeat(5, 1fr);
}

.disciples-modal .crafting-footer,
.disciple-missions-modal .crafting-footer {
    margin-top: 0;
    padding: 15px;
    flex-shrink: 0;
}

.disciple-missions-modal {
    color: var(--p-ffffff);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.missions-inner {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.disciple-missions-modal .disciples-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.no-disciples {
    text-align: center;
    padding: 40px;
    color: var(--p-888888);
    font-size: 1.2em;
}

.disciple-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.disciple-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.disciple-name {
    font-size: 1.1em;
    font-weight: bold;
}

.disciple-weapon {
    font-size: 1.3em;
}

.disciple-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
}

.disciple-rank {
    color: var(--ui-teal);
}

.disciple-realm {
    color: var(--p-888888);
    font-size: 0.85em;
}

.disciple-proficiency {
    color: var(--p-f59e0b);
    font-size: 0.85em;
    padding: 4px 8px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 4px;
    margin: 4px 0;
}

.disciple-crafting-talents {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.8em;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin: 4px 0;
}

.crafting-talent-item {
    display: flex;
    gap: 4px;
}

.disciple-stats {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    box-sizing: border-box;
    font-size: 0.9em;
    color: var(--p-cccccc);
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.disciple-multipliers {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    box-sizing: border-box;
    font-size: 0.8em;
    color: var(--p-888888);
}

.stat-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.disciple-cost {
    font-size: 0.85em;
    color: var(--ui-gold);
}

.disciple-status {
    font-size: 0.85em;
}

.disciple-status .on-mission {
    color: var(--ui-orange);
}

.disciple-status .available {
    color: var(--p-4caf50);
}

.disciple-status .workshop {
    color: var(--ui-info);
}

.disciple-status .shopkeeper {
    color: var(--ui-gold);
}

.disciple-status .busy {
    color: var(--p-f44336);
}

.disciple-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.disciple-actions button {
    flex: 1 1 auto;
    min-width: 60px;
    padding: 6px 10px;
    font-size: 0.85em;
}

/* Disciple Detail Modal */
.disciple-detail-modal {
    display: flex;
    flex-direction: column;
    gap: 20px;
    color: var(--p-ffffff);
}

.disciple-detail-header {
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--p-444444);
}

.disciple-name-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.disciple-name-input {
    background: transparent;
    border: 2px solid;
    font-size: 1.5em;
    padding: 8px 15px;
    border-radius: 8px;
    text-align: center;
    font-family: inherit;
    min-width: 200px;
}

.disciple-subtitle {
    color: var(--p-aaaaaa);
    font-size: 1em;
}

.disciple-detail-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
}

.disciple-detail-section h3 {
    color: var(--ui-gold);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--p-444444);
    padding-bottom: 8px;
    font-size: 1.1em;
}

.disciple-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.stat-box {
    background: rgba(78, 205, 196, 0.1);
    border: 1px solid var(--ui-teal);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.stat-box.highlight {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--ui-gold);
}

.stat-label {
    display: block;
    color: var(--p-888888);
    font-size: 0.85em;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    color: var(--ui-teal);
    font-size: 1.3em;
    font-weight: bold;
}

.stat-box.highlight .stat-value {
    color: var(--ui-gold);
}

.stat-mult {
    display: block;
    color: var(--p-666666);
    font-size: 0.75em;
    margin-top: 3px;
}

.talent-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.talent-box {
    border: 2px solid;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
}

.talent-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.talent-icon {
    font-size: 1.3em;
}

.talent-name {
    font-weight: bold;
    font-size: 0.95em;
}

.talent-points {
    color: var(--p-ffffff);
    font-size: 1.1em;
    margin-bottom: 5px;
    text-align: center;
    width: 100%;
}

.talent-bonus {
    color: var(--ui-teal);
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.talent-desc {
    color: var(--p-888888);
    font-size: 0.75em;
}

.proficiency-info {
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.proficiency-bonus {
    color: var(--ui-teal);
    font-weight: bold;
}

.cultivation-manual-display {
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid var(--ui-teal);
}

.manual-name {
    color: var(--ui-gold);
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 8px;
}

.manual-desc {
    color: var(--p-aaaaaa);
    margin-bottom: 8px;
    font-size: 0.9em;
}

.manual-stats {
    color: var(--ui-teal);
    font-size: 0.9em;
}

.manual-info {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.manual-tier {
    color: var(--ui-teal);
    font-weight: bold;
}

.manual-rarity {
    font-weight: bold;
}

.manual-efficiency {
    color: var(--p-aaaaaa);
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.equipment-slot {
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed var(--p-555555);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.equipment-slot:hover {
    border-color: var(--ui-teal);
    border-style: solid;
    background: rgba(78, 205, 196, 0.1);
}

.slot-name {
    color: var(--p-888888);
    font-size: 0.85em;
    margin-bottom: 8px;
}

.item-name {
    font-weight: bold;
    font-size: 0.95em;
    margin-bottom: 5px;
}

.item-rarity {
    font-size: 0.75em;
    margin-bottom: 5px;
    text-transform: capitalize;
}

.item-stats {
    color: var(--ui-teal);
    font-size: 0.85em;
}

/* Equipment Selection Modal */
.equipment-selection {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
}

.equipment-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--p-444444);
    border-radius: 8px;
    cursor: pointer;
    color: var(--p-ffffff);
    transition: all 0.3s;
    font-family: inherit;
    font-size: 1em;
}

.equipment-option:hover {
    background: rgba(78, 205, 196, 0.1);
    border-color: var(--ui-teal);
}

.equipment-option.selected {
    background: rgba(78, 205, 196, 0.2);
    border-color: var(--ui-teal);
}

.equipment-option.unequip {
    border-color: var(--p-666666);
}

.equipment-option.unequip:hover {
    border-color: var(--p-888888);
}

.option-name {
    font-weight: bold;
}

.option-rarity {
    font-size: 0.85em;
    text-transform: capitalize;
}

.option-stats {
    color: var(--ui-teal);
}

.equipped-badge {
    background: var(--ui-teal);
    color: var(--p-000000);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: bold;
}

.no-items {
    text-align: center;
    color: var(--p-888888);
    padding: 20px;
}

.btn-info {
    background: linear-gradient(135deg, var(--p-3b82f6), var(--p-2563eb));
}

.btn-info:hover {
    background: linear-gradient(135deg, var(--p-60a5fa), var(--p-3b82f6));
}

@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
    .disciple-stats-grid,
    .talent-grid,
    .equipment-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cultivation-manual-row {
        flex-direction: column;
    }

    .manual-select {
        width: 100%;
    }
}

/* Buildings Modal */
.buildings-modal {
    color: var(--p-ffffff);
}

.buildings-resources {
    display: flex;
    gap: 30px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.buildings-grid {
    max-height: calc(85vh - 180px);
    overflow-y: auto;
}

.building-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.building-card.max-level {
    border-color: var(--ui-gold);
    background: rgba(255, 215, 0, 0.1);
}

.building-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.building-icon {
    font-size: 1.5em;
}

.building-name {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--ui-gold);
}

.building-level {
    color: var(--ui-teal);
    font-weight: bold;
}

.building-description {
    color: var(--p-aaaaaa);
    font-size: 0.9em;
    line-height: 1.4;
}

.building-effect {
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    font-size: 0.9em;
}

.effect-current {
    color: var(--ui-teal);
}

.effect-next {
    color: var(--ui-gold);
    margin-top: 5px;
}

.building-cost {
    display: flex;
    gap: 20px;
    font-size: 0.95em;
    color: var(--p-cccccc);
}

.max-level-text {
    text-align: center;
    color: var(--ui-gold);
    font-weight: bold;
    padding: 10px;
}

/* Recruitment Modal */
.recruitment-modal {
    color: var(--p-ffffff);
}

.recruitment-info {
    text-align: center;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.recruitment-info p {
    margin: 10px 0;
    color: var(--p-cccccc);
}

.recruitment-info .current-stones {
    color: var(--ui-gold);
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 15px;
}

.recruitment-amount {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.recruitment-amount label {
    color: var(--ui-teal);
    font-weight: bold;
}

.recruitment-amount input {
    padding: 12px 20px;
    font-size: 1.1em;
    background: rgba(30, 30, 50, 0.9);
    border: 2px solid var(--ui-teal);
    border-radius: 8px;
    color: var(--p-ffffff);
    width: 200px;
    text-align: center;
}

.recruitment-amount input:focus {
    outline: none;
    border-color: var(--ui-gold);
}

.percent-display {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--ui-teal);
    min-width: 60px;
    text-align: right;
}

.recruit-slider {
    width: 100%;
    height: 12px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--p-333333), var(--ui-teal));
    border-radius: 6px;
    outline: none;
    cursor: pointer;
}

.recruit-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--ui-teal), var(--ui-teal-2));
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid var(--p-ffffff);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s;
}

.recruit-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.recruit-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--ui-teal), var(--ui-teal-2));
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid var(--p-ffffff);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    color: var(--p-666666);
    font-size: 0.85em;
}

.recruitment-actions {
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.recruitment-actions .btn-primary {
    padding: 15px 40px;
    font-size: 1.1em;
    background: linear-gradient(135deg, var(--ui-teal), var(--ui-teal-2));
    border: none;
    border-radius: 10px;
    color: var(--p-ffffff);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.recruitment-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(78, 205, 196, 0.4);
}

.recruitment-actions .btn-cancel {
    padding: 15px 40px;
    font-size: 1.1em;
    background: linear-gradient(135deg, var(--p-666666), var(--p-555555));
    border: none;
    border-radius: 10px;
    color: var(--p-ffffff);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.recruitment-actions .btn-cancel:hover {
    background: linear-gradient(135deg, var(--p-777777), var(--p-666666));
    transform: translateY(-2px);
}

/* Candidates Screen */
.candidates-header {
    text-align: center;
    margin-bottom: 20px;
}

.candidates-header h3 {
    color: var(--ui-gold);
    font-size: 1.4em;
    margin-bottom: 10px;
}

.candidates-header p {
    color: var(--p-cccccc);
    margin: 5px 0;
}

.candidates-hint {
    color: var(--ui-teal) !important;
    font-style: italic;
}

.candidates-grid {
    /* Let modal handle scrolling */
}

.candidate-card {
    text-align: center;
    transition: all 0.3s;
}

.candidate-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.4);
}

.candidate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.candidate-name {
    font-size: 1.1em;
    font-weight: bold;
}

.candidate-weapon {
    font-size: 1.3em;
}

.candidate-rarity {
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 5px;
}

.candidate-weapon-name {
    color: var(--p-888888);
    font-size: 0.85em;
    margin-bottom: 10px;
}

.candidate-multipliers {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 10px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.mult-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mult-label {
    font-size: 0.75em;
    color: var(--p-888888);
}

.mult-value {
    font-weight: bold;
    color: var(--p-cccccc);
}

.mult-value.high {
    color: var(--p-4caf50);
}

.mult-value.low {
    color: var(--ui-danger);
}

/* Talent Distribution Bars */
.candidate-talents,
.disciple-talents {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    margin: 8px 0;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.candidate-talent-points,
.disciple-talent-points {
    text-align: center;
    font-size: 0.85em;
    color: var(--p-aaaaaa);
    margin: 4px 0;
}

.talent-bar-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    margin: 3px 0;
    font-size: 0.8em;
}

.talent-label {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Candidate Subtalents (Alchemy & Forge) */
.candidate-subtalents {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 8px 0;
    padding: 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.subtalent-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9em;
}

.subtalent-item .subtalent-icon {
    font-size: 1.1em;
}

.subtalent-item .subtalent-pts {
    font-weight: bold;
}

.candidate-cost {
    font-size: 0.85em;
    color: var(--ui-gold);
    margin-top: 10px;
}

.btn-recruit {
    width: 100%;
    margin-top: 12px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--ui-teal), var(--ui-teal-2));
    border: none;
    border-radius: 8px;
    color: var(--p-ffffff);
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-recruit:hover {
    background: linear-gradient(135deg, var(--p-5fd4cc), var(--ui-teal));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.4);
}

.recruited-count {
    color: var(--p-4caf50);
    font-weight: bold;
}

.remaining-count {
    color: var(--ui-gold);
    font-weight: bold;
}

.candidates-actions {
    text-align: center;
    margin-top: 20px;
}

.candidates-actions .btn-primary {
    padding: 15px 50px;
    font-size: 1.1em;
    background: linear-gradient(135deg, var(--ui-teal), var(--ui-teal-2));
    border: none;
    border-radius: 10px;
    color: var(--p-ffffff);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.candidates-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(78, 205, 196, 0.4);
}

.btn-secondary {
    padding: 12px 30px;
    background: rgba(100, 100, 100, 0.5);
    border: 2px solid var(--p-666666);
    border-radius: 8px;
    color: var(--p-cccccc);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(150, 150, 150, 0.5);
    border-color: var(--p-888888);
}

/* Rarity Chances Display */
.rarity-chances {
    margin: 20px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(78, 205, 196, 0.3);
}

.rarity-chances-title {
    text-align: center;
    color: var(--ui-gold);
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 15px;
}

.rarity-chances-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rarity-chance-item {
    display: grid;
    grid-template-columns: 120px 1fr 70px;
    align-items: center;
    gap: 10px;
}

.rarity-chance-label {
    font-weight: bold;
    font-size: 0.9em;
    text-transform: capitalize;
}

.rarity-chance-bar-container {
    height: 16px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.rarity-chance-bar {
    height: 100%;
    border-radius: 8px;
    transition: width 0.3s ease, background 0.3s ease;
    box-shadow: 0 0 10px currentColor;
}

.rarity-chance-percent {
    font-weight: bold;
    font-size: 0.9em;
    text-align: right;
}

/* ─── Mobile Sect UI ─── */
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
    .sect-inventory-modal .sect-statgrid--2 {
        grid-template-columns: 1fr;
    }

    .sect-inventory-modal .sect-stat__value {
        white-space: normal;
        overflow: visible;
        overflow-wrap: anywhere;
    }

    .disciples-filters {
        gap: 6px;
        padding: 6px;
    }

    .filter-group {
        gap: 4px;
    }

    .filter-group label {
        font-size: 0.7em;
    }

    .filter-group select {
        padding: 4px 6px;
        font-size: 0.8em;
    }

    .disciples-list {
        grid-template-columns: repeat(2, 1fr) !important;
        padding: 6px 0;
    }

    .disciples-modal .crafting-footer,
    .disciple-missions-modal .crafting-footer {
        padding: 4px;
    }

    .disciples-modal .btn-close-modal,
    .disciple-missions-modal .btn-close-modal {
        padding: 6px 20px;
        font-size: 0.8em;
    }

    .disciples-modal .modal-inner,
    .disciple-missions-modal .modal-inner {
        padding: 6px !important;
    }

    .disciple-card-compact {
        padding: 6px 8px !important;
    }

    .disciple-card-compact .disciple-name {
        font-size: 0.85em;
    }

    .disciple-card-compact .disciple-info {
        margin-bottom: 2px;
    }

    .disciple-card-compact .disciple-rank,
    .disciple-card-compact .disciple-rarity {
        font-size: 0.75em;
    }

    .disciple-card-compact .disciple-realm {
        font-size: 0.7em;
    }

    .disciple-missions-modal .modal-inner {
        padding: 6px !important;
    }

    .disciple-missions-modal .btn-close-modal {
        padding: 6px 20px;
        font-size: 0.8em;
    }

    /* Compact close button for all modals on mobile */
    .modal-inner > button[data-action="modalCloseById"] {
        padding: 6px 20px !important;
        font-size: inherit !important;
        margin-top: 6px !important;
    }
}

/* ============================================
   LEADERBOARD
   ============================================ */
.sm-leaderboard { margin-top: 12px; }
.sm-section-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--p-e8d5b7);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sm-lb-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}
.sm-lb-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    background: rgba(255,255,255,0.02);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.06);
    text-align: center;
    transition: background 0.2s;
}
.sm-lb-cell:hover { background: rgba(255,255,255,0.05); }
.sm-lb-target { background: rgba(78,205,196,0.08); border-color: rgba(78,205,196,0.3); }
.sm-lb-player { background: rgba(255,215,0,0.06); border-color: rgba(255,215,0,0.3); }
.sm-lb-pos { color: var(--p-888888); font-size: 10px; font-weight: 600; }
.sm-lb-svg { line-height: 0; }
.sm-lb-name { font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sm-lb-rank { font-size: 9px; opacity: 0.7; }
.sm-lb-realm { color: var(--p-888888); font-size: 9px; }
.sm-lb-challenge-btn {
    padding: 3px 10px;
    margin-top: 2px;
    border-radius: 4px;
    border: 1px solid var(--ui-teal);
    background: rgba(78,205,196,0.15);
    color: var(--ui-teal);
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}
.sm-lb-challenge-btn:hover { background: rgba(78,205,196,0.3); }
.sm-lb-mentor-badge {
    margin-top: 3px;
    padding: 1px 7px;
    border-radius: 4px;
    background: rgba(52,152,219,0.18);
    border: 1px solid rgba(52,152,219,0.5);
    color: var(--ui-blue);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ============================================
   FACILITIES
   ============================================ */
.sm-facilities { margin-top: 12px; }
.sm-fac-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sm-fac-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.02);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.04);
}
.sm-fac-locked { opacity: 0.45; }
.sm-fac-unlocked { border-color: rgba(78,205,196,0.15); }
.sm-fac-icon { font-size: 18px; min-width: 24px; text-align: center; }
.sm-fac-info { flex: 1; }
.sm-fac-name { font-size: 12px; font-weight: 600; color: var(--p-cccccc); }
.sm-fac-desc { font-size: 11px; color: var(--p-888888); }
.sm-fac-bonus {
    font-size: 13px;
    font-weight: 700;
    color: var(--ui-teal);
    min-width: 50px;
    text-align: right;
}
.sm-fac-locked .sm-fac-bonus { color: var(--p-666666); }
