/* ====================================================
   제네시스 해방 계산기 스타일
   ==================================================== */
.lib-calc-container { max-width: 1200px; margin: 0 auto; padding: 40px 20px 80px; }
.lib-calc-header { text-align: center; margin-bottom: 26px; }
.lib-calc-header h1 { font-size: 28px; color: #3C3744; margin: 0 0 8px; }
.lib-calc-sub { color: #666; font-size: 14px; margin: 0; }

.lib-calc-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 22px;
    align-items: flex-start;
}

.lib-card {
    background: #fff;
    border: 1px solid #e6e8ef;
    border-radius: 12px;
    padding: 22px;
}
.lib-card-title {
    font-size: 17px;
    color: #3C3744;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef0f5;
}

/* ============ 입력 영역 ============ */
.lib-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}
.lib-field { display: flex; flex-direction: column; }
.lib-field-label {
    font-size: 13px; font-weight: 700; color: #3C3744; margin-bottom: 6px;
}
.lib-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d4d8e2;
    border-radius: 8px;
    font-size: 14px;
    color: #3C3744;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.lib-input:focus {
    outline: none;
    border-color: #B4C5E4;
    box-shadow: 0 0 0 3px rgba(180, 197, 228, 0.25);
}
.lib-hint {
    font-size: 11px; color: #888; margin: 6px 0 0;
}

/* 커스텀 퀘스트 드롭다운 (보스 아이콘 표시용) */
.lib-quest-wrap { position: relative; }
.lib-quest-trigger {
    display: flex; align-items: center; gap: 8px;
    width: 100%;
    padding: 6px 12px;
    height: 38px;
    background: #fff;
    border: 1px solid #d4d8e2;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    box-sizing: border-box;
}
.lib-quest-trigger:hover { border-color: #B4C5E4; }
.lib-quest-trigger.open {
    border-color: #B4C5E4;
    box-shadow: 0 0 0 3px rgba(180, 197, 228, 0.25);
}
.lib-quest-icon {
    width: 26px; height: 26px;
    object-fit: cover; border-radius: 50%;
    background: #eee;
    flex-shrink: 0;
}
.lib-quest-label {
    flex: 1;
    font-size: 14px; color: #3C3744; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lib-quest-arrow {
    color: #888; font-size: 11px;
    transition: transform 0.18s;
    flex-shrink: 0;
}
.lib-quest-trigger.open .lib-quest-arrow { transform: rotate(180deg); }

.lib-quest-menu {
    position: absolute;
    top: calc(100% + 4px); left: 0; right: 0;
    z-index: 50;
    background: #fff;
    border: 1px solid #d4d8e2;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.10);
    list-style: none;
    margin: 0; padding: 4px;
    max-height: 320px;
    overflow-y: auto;
    display: none;
}
.lib-quest-menu.open { display: block; }
.lib-quest-menu li {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #3C3744;
    transition: background 0.1s;
}
.lib-quest-menu li:hover { background: #f4f5f9; }
.lib-quest-menu li.selected {
    background: #fff7e6;
    color: #f39c12;
    font-weight: 700;
}
.lib-quest-menu li img {
    width: 26px; height: 26px;
    object-fit: cover; border-radius: 50%;
    background: #eee;
    flex-shrink: 0;
}

/* 제네시스 패스 이미지 + 토글 가로 정렬 */
.lib-pass-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.lib-pass-img {
    height: 38px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

/* 토글 */
.lib-toggle {
    display: inline-flex; align-items: center; gap: 10px;
    cursor: pointer; padding: 6px 0;
    user-select: none;
}
.lib-toggle input { display: none; }
.lib-toggle-track {
    position: relative;
    width: 44px; height: 24px;
    background: #ccd3e0;
    border-radius: 12px;
    transition: background 0.18s;
}
.lib-toggle-thumb {
    position: absolute;
    top: 3px; left: 3px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
    transition: left 0.18s;
}
.lib-toggle input:checked + .lib-toggle-track { background: #f39c12; }
.lib-toggle input:checked + .lib-toggle-track .lib-toggle-thumb { left: 23px; }
.lib-toggle-text {
    font-size: 13px; color: #3C3744; font-weight: 600;
}

.lib-section-title {
    font-size: 14px; font-weight: 700; color: #3C3744;
    margin: 22px 0 10px;
    padding-left: 8px;
    border-left: 3px solid #B4C5E4;
}

/* ============ 보스 행 ============ */
.lib-boss-header {
    display: grid;
    grid-template-columns: 28px 92px 1fr 115px 56px 28px;
    gap: 8px;
    padding: 0 10px 6px;
    font-size: 11px;
    font-weight: 700;
    color: #888;
    letter-spacing: 0.4px;
}
.lib-bh-cell {
    text-align: center;
    white-space: nowrap;
}
.lib-bh-boss {
    grid-column: 2 / 4;
    text-align: left;
    padding-left: 4px;
}
.lib-boss-list {
    display: flex; flex-direction: column;
    gap: 6px;
}
.lib-boss-row {
    display: grid;
    grid-template-columns: 28px 92px 1fr 115px 56px 28px;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #fafbfd;
    border: 1px solid #eef0f5;
    border-radius: 8px;
    transition: background 0.12s, opacity 0.12s;
}
.lib-boss-row.lib-boss-off {
    opacity: 0.5; background: #f4f5f9;
}
.lib-boss-row.lib-boss-cleared {
    background: #fff7e6; border-color: #ffe0a3;
}
.lib-boss-include {
    width: 18px; height: 18px;
    cursor: pointer;
}
.lib-boss-imgwrap {
    display: flex; align-items: center; gap: 6px;
    min-width: 0;
}
.lib-boss-img {
    width: 30px; height: 30px;
    object-fit: cover; border-radius: 50%;
    background: #eee;
    flex-shrink: 0;
}
.lib-boss-name {
    font-size: 13px; font-weight: 700; color: #3C3744;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lib-boss-diff {
    width: 100%; padding: 6px 8px;
    border: 1px solid #d4d8e2;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    color: #3C3744;
    cursor: pointer;
}
.lib-boss-party {
    display: flex; align-items: center;
    border: 1px solid #d4d8e2;
    border-radius: 6px;
    overflow: hidden;
}
.lib-boss-party button {
    width: 22px; height: 28px;
    background: #f4f5f9;
    border: 0;
    color: #3C3744;
    font-size: 14px; font-weight: 700;
    cursor: pointer;
}
.lib-boss-party button:hover { background: #e8eaf2; }
.lib-boss-party-value {
    flex: 1; text-align: center;
    font-size: 13px; font-weight: 600; color: #3C3744;
    min-width: 28px;
}
.lib-boss-points {
    font-size: 13px; font-weight: 700; color: #3C3744;
    text-align: right;
    padding: 0 4px;
}
.lib-boss-week {
    display: flex; align-items: center; justify-content: center;
}
.lib-boss-week input {
    width: 16px; height: 16px;
    cursor: pointer;
}

/* ============ 액션 버튼 ============ */
.lib-actions {
    display: flex; gap: 10px;
    margin-top: 22px;
}
.lib-btn {
    flex: 1;
    padding: 12px 18px;
    border: 0; border-radius: 8px;
    font-size: 14px; font-weight: 700;
    cursor: pointer;
    transition: background 0.12s, transform 0.06s;
}
.lib-btn:active { transform: translateY(1px); }
.lib-btn-primary {
    background: #3C3744; color: #fff;
}
.lib-btn-primary:hover { background: #2d2935; }
.lib-btn-ghost {
    background: #f4f5f9; color: #3C3744;
    flex: 0 0 auto;
}
.lib-btn-ghost:hover { background: #e8eaf2; }

/* ============ 결과 카드 ============ */
.lib-result-card {
    position: sticky; top: 20px;
}

.lib-progress-wrap { margin-bottom: 22px; }
.lib-progress-row {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 8px;
}
.lib-progress-label { font-size: 13px; font-weight: 700; color: #3C3744; }
.lib-progress-value { font-size: 14px; font-weight: 700; color: #3C3744; }
.lib-progress-bar {
    height: 18px;
    background: #f0f2f7;
    border-radius: 9px;
    overflow: hidden;
    position: relative;
}
.lib-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #B4C5E4, #f39c12);
    width: 0%;
    transition: width 0.36s ease;
    border-radius: 9px;
}
.lib-progress-percent {
    font-size: 11px; font-weight: 600; color: #888;
    margin-top: 5px; text-align: right;
}

.lib-result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}
.lib-stat {
    background: #fafbfd;
    border: 1px solid #eef0f5;
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
}
.lib-stat-label {
    font-size: 11px; color: #888;
    margin-bottom: 4px;
}
.lib-stat-value {
    font-size: 16px; font-weight: 800;
    color: #3C3744;
}

.lib-result-final {
    background: linear-gradient(135deg, #f8f9fb, #fff);
    border: 1px solid #e6e8ef;
    border-radius: 10px;
    padding: 14px 16px;
}
.lib-final-row {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 6px 0;
}
.lib-final-row + .lib-final-row {
    border-top: 1px dashed #e6e8ef;
}
.lib-final-label { font-size: 13px; color: #666; }
.lib-final-value {
    font-size: 15px; font-weight: 700; color: #3C3744;
}
.lib-final-value-strong {
    font-size: 18px; color: #f39c12;
}

.lib-breakdown {
    margin-top: 16px;
    border-top: 1px dashed #e6e8ef;
    padding-top: 14px;
    font-size: 12px;
    color: #666;
    line-height: 1.7;
    display: none;
}
.lib-breakdown.lib-breakdown-show { display: block; }
.lib-breakdown b { color: #3C3744; }
.lib-breakdown-row {
    display: flex; justify-content: space-between;
    padding: 2px 0;
}

.lib-disclaimer {
    font-size: 11px; color: #888;
    margin: 16px 0 0; line-height: 1.6;
}

/* ============ 반응형 ============ */
@media (max-width: 980px) {
    .lib-calc-grid { grid-template-columns: 1fr; }
    .lib-result-card { position: static; }
}

@media (max-width: 600px) {
    .lib-calc-container { padding: 24px 12px 60px; }
    .lib-calc-header h1 { font-size: 22px; }
    .lib-card { padding: 16px; }
    .lib-field-row { grid-template-columns: 1fr; gap: 10px; }
    .lib-boss-row {
        grid-template-columns: 24px 30px 1fr 95px 36px 22px;
        gap: 6px;
        padding: 6px 8px;
    }
    .lib-boss-header {
        grid-template-columns: 24px 30px 1fr 95px 36px 22px;
        gap: 6px;
        padding: 0 8px 4px;
        font-size: 10px;
    }
    .lib-boss-name { display: none; }
    .lib-boss-img { width: 28px; height: 28px; }
    .lib-boss-points { font-size: 12px; }
    .lib-result-stats { grid-template-columns: 1fr 1fr; }
    .lib-stat:last-child { grid-column: span 2; }
    .lib-final-value-strong { font-size: 16px; }
}
