/* ==========================================================================
   FABULA ULTIMA TTRPG - STYLESHEET (Spójny z index.html & style.css)
   ========================================================================== */

/* Kontener główny serwisu Fabula */
.fabula-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: relative;
    z-index: 1;
}

/* Ukrywanie elementów */
.hidden {
    display: none !important;
}

/* ==========================================================================
   1. NAGŁÓWEK SERWISU (HEADER)
   ========================================================================== */
.fabula-header-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    background: rgba(17, 11, 26, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    position: sticky;
    top: 15px;
    z-index: 1000;
}

.fabula-header-card:hover {
    transform: none;
}

.fabula-badge {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(56, 189, 248, 0.3));
    border: 1px solid rgba(192, 132, 252, 0.4);
    color: #e9d5ff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Przyciski w nagłówku - wyraźnie rozdzielone, bez podkreślenia */
.fabula-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-btn {
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    line-height: 1.2;
}

.header-btn,
.header-btn:hover,
.header-btn:focus,
.header-btn:visited,
.header-btn * {
    text-decoration: none !important;
}

.header-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(192, 132, 252, 0.3);
    color: #e2e8f0;
}

.header-btn-secondary:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: #c084fc;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
}

.header-btn-primary {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    border: 1px solid rgba(192, 132, 252, 0.5);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
}

.header-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(168, 85, 247, 0.6);
    filter: brightness(1.1);
}

/* ==========================================================================
   2. GŁÓWNE MENU SERWISU (KARTA POSTACI vs KOMPENDIUM)
   ========================================================================== */
.fabula-main-menu {
    display: flex;
    gap: 14px;
    background: rgba(20, 14, 32, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 8px;
    width: fit-content;
}

.main-menu-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #cbd5e1;
    padding: 10px 22px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
}

.main-menu-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.main-menu-btn.active {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.35), rgba(124, 58, 237, 0.35));
    border-color: #c084fc;
    color: #ffffff;
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.4);
}

/* ==========================================================================
   3. SELEKTOR POSTACI
   ========================================================================== */
.char-selector-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(20, 14, 32, 0.75);
    border: 1px solid rgba(192, 132, 252, 0.25);
    border-radius: 18px;
    flex-wrap: wrap;
    gap: 16px;
}

.char-select-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.char-select-dropdown {
    background: #151022;
    border: 1px solid rgba(192, 132, 252, 0.4);
    color: #ffffff;
    padding: 9px 18px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.2);
    transition: all 0.2s ease;
}

.char-select-dropdown:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
}

.char-quick-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.char-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.char-pill:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: #c084fc;
    color: #ffffff;
    transform: translateY(-2px);
}

.char-pill.active {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    border-color: #c084fc;
    color: #ffffff;
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.4);
}

/* ==========================================================================
   4. KARTA BOHATERA (HERO CARD - BEZ EMOTKI AWATARA)
   ========================================================================== */
.character-hero-card {
    padding: 32px 36px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 36px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(168, 85, 247, 0.14) 100%);
    border: 1px solid rgba(192, 132, 252, 0.3);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

.char-meta-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.char-name-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.char-name-row h1 {
    font-family: 'Audiowide', sans-serif;
    font-size: 2.3rem;
    color: #ffffff;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.char-level-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 6px 14px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
    font-family: 'JetBrains Mono', monospace;
}

.campaign-tag {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #7dd3fc;
    font-size: 0.82rem;
    padding: 5px 12px;
    border-radius: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.char-aspects {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #e2e8f0;
    font-size: 0.95rem;
    margin-top: 4px;
}

.aspect-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.aspect-label {
    color: #94a3b8;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.aspect-value {
    color: #f1f5f9;
    font-weight: 500;
}

.aspect-highlight {
    color: #38bdf8;
    font-weight: 600;
}

/* Pigułki punktów i progresji */
.char-points-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 200px;
}

.point-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 9px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.point-pill-label {
    font-size: 0.82rem;
    color: #94a3b8;
    font-weight: 500;
}

.point-pill-val {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffffff;
}

/* ==========================================================================
   5. PASKI ZASOBÓW (HP, MP, IP - POJEDYNCZY DŁUGI PASEK)
   ========================================================================== */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.resource-card {
    background: rgba(17, 11, 26, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.resource-card:hover {
    transform: translateY(-3px);
}

.resource-card.hp-card { border-color: rgba(239, 68, 68, 0.4); }
.resource-card.mp-card { border-color: rgba(56, 189, 248, 0.4); }
.resource-card.ip-card { border-color: rgba(245, 158, 11, 0.4); }

.resource-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.resource-title {
    font-family: 'Audiowide', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.hp-title { color: #f87171; }
.mp-title { color: #38bdf8; }
.ip-title { color: #fbbf24; }

.resource-values {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
}

.resource-max {
    color: #64748b;
    font-size: 1rem;
    font-weight: normal;
}

.resource-bar-wrapper {
    width: 100%;
}

/* Długi, estetyczny pasek postępu */
.resource-bar-track {
    width: 100%;
    height: 14px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.resource-bar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hp-fill { background: linear-gradient(90deg, #dc2626, #ef4444); box-shadow: 0 0 14px rgba(239, 68, 68, 0.7); }
.mp-fill { background: linear-gradient(90deg, #2563eb, #38bdf8); box-shadow: 0 0 14px rgba(56, 189, 248, 0.7); }
.ip-fill { background: linear-gradient(90deg, #d97706, #fbbf24); box-shadow: 0 0 14px rgba(251, 191, 36, 0.7); }

.resource-subinfo {
    font-size: 0.8rem;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
}

/* ==========================================================================
   6. STATYSTYKI / CECHY (BEZ LITERKI D) ORAZ OBRONA
   ========================================================================== */
.stats-defense-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.attributes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.attribute-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 20px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.attribute-card:hover {
    transform: translateY(-4px);
    border-color: #c084fc;
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.25);
    background: rgba(255, 255, 255, 0.07);
}

.attr-name {
    font-family: 'Audiowide', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #cbd5e1;
    letter-spacing: 0.5px;
}

/* Liczba statystyki bez literki 'd' */
.attr-die {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.2rem;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(135deg, #c084fc, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

/* Karty obrony */
.defense-cards-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.defense-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(192, 132, 252, 0.25);
    border-radius: 18px;
    padding: 18px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.defense-card-title {
    font-family: 'Audiowide', sans-serif;
    font-size: 0.95rem;
    color: #d8b4fe;
}

.defense-card-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
}

.defense-card-formula {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 8px;
}

/* ==========================================================================
   7. ZAKŁADKI KARTY POSTACI (OSTYLOWANE PRZYCISKI I ODSTĘPY)
   ========================================================================== */
.sheet-tabs-container {
    background: rgba(17, 11, 26, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sheet-tabs-nav {
    display: flex;
    gap: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 16px;
    flex-wrap: wrap;
}

/* Wyraziste, dopracowane przyciski zakładek */
.sheet-tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #cbd5e1;
    padding: 12px 26px;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
}

.sheet-tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(192, 132, 252, 0.4);
    transform: translateY(-2px);
}

.sheet-tab-btn.active {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.35), rgba(124, 58, 237, 0.35));
    border-color: #c084fc;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

/* Lista umiejętności i grupy klas */
.skills-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.class-skill-group {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 28px;
}

.class-skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.class-title-badge {
    font-family: 'Audiowide', sans-serif;
    font-size: 1.35rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.class-lvl-tag {
    background: rgba(168, 85, 247, 0.25);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #e9d5ff;
    padding: 5px 12px;
    border-radius: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
}

.skill-card {
    background: rgba(13, 10, 21, 0.7);
    border: 1px solid rgba(192, 132, 252, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 14px;
    transition: all 0.25s ease;
}

.skill-card:hover {
    border-color: #c084fc;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.25);
    transform: translateY(-2px);
}

.skill-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.skill-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

.skill-rank-badge {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}

.skill-desc {
    color: #cbd5e1;
    font-size: 0.92rem;
    line-height: 1.65;
}

.fabula-tag {
    display: inline-block;
    background: rgba(168, 85, 247, 0.25);
    border: 1px solid rgba(192, 132, 252, 0.4);
    color: #e9d5ff;
    padding: 2px 7px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Siatka Ekwipunku */
.equipment-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 22px;
}

.slot-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.25s ease;
}

.slot-card:hover {
    transform: translateY(-3px);
    border-color: rgba(192, 132, 252, 0.4);
}

.slot-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #94a3b8;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.item-name-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.item-icon {
    font-size: 1.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
}

.item-stats-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.item-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 4px 10px;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    color: #e2e8f0;
}

/* ==========================================================================
   8. WIDOK DEDYKOWANEGO KOMPENDIUM
   ========================================================================== */
.compendium-container {
    background: rgba(17, 11, 26, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Responsywność */
@media (max-width: 950px) {
    .character-hero-card {
        flex-direction: column;
        align-items: stretch;
    }

    .resources-grid {
        grid-template-columns: 1fr;
    }

    .stats-defense-grid {
        grid-template-columns: 1fr;
    }

    .attributes-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .fabula-header-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
}
