/* Wiki Symbols & Flags */
.wiki-symbol{
    display: inline-block;
    height: 50px;
    width: auto;
    vertical-align: text-bottom;
    margin: 0 2px; 
}


.wiki-flag {
    display: inline-block;
    height: 1.2em;
    width: auto;
    vertical-align: text-bottom;
    margin: 0 2px;
}

/* Images */
.wiki-image {
    margin: 25px auto;
    text-align: center;
}

.wiki-image-left {
    float: left;
    margin: 10px 20px 10px 0;
    text-align: left;
}

.wiki-image-right {
    float: right;
    margin: 10px 0 10px 20px;
    text-align: right;
}

.wiki-image-center {
    margin: 25px auto;
    text-align: center;
}

.wiki-image img {
    max-width: 100%;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
}

.wiki-image img:hover {
    transform: scale(1.02);
    border-color: var(--accent-main);
    box-shadow: var(--shadow-lg);
}

.wiki-image figcaption {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 14px;
    font-style: italic;
}

.wiki-image-hero {
    width: 100%;
    margin: 40px 0;
}

.wiki-image-hero img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 16px;
}

.wiki-image-shadow img {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.7);
}

/* Tables */
/* Tabele wiki */
.wiki-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
}

.wiki-table th,
.wiki-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid var(--border-subtle);
}

.wiki-table th {
    background: var(--accent-main);
    color: white;
    font-weight: 600;
    text-align: center;
}

.wiki-table th[colspan] {
    background: linear-gradient(135deg, var(--border-subtle) 0%, var(--accent-strong) 50%, var(--border-subtle) 100%);
    font-size: 1.2em;
    text-align: center;
    padding: 15px;
}


.wiki-table tr:nth-child(even) {
    background: var(--bg-surface);
}

.wiki-table tr:hover {
    background: var(--bg-surface-alt);
}

/* Obrazy w tabelach - inline obok siebie */
.wiki-table figure.wiki-image {
    display: inline-block;
    margin: 2px;
    vertical-align: middle;
}

.wiki-table figure.wiki-image img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
}

.wiki-table figcaption {
    display: none; /* Ukryj podpisy w tabelach */
}

/* Nazwa technologii */
.wiki-table td strong {
    display: block;
    margin-top: 8px;
    text-align: center;
    color: var(--accent-main);
}


/* Code Blocks */
pre {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    margin: 25px 0;
    box-shadow: var(--shadow-md);
}

pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
}

/* Inline code */
code {
    background: rgba(0, 0, 0, 0.18);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: 5px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
}

/* Tags */
.wiki-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    color: var(--accent-hover);
    border-radius: 15px;
    font-size: 13px;
    font-weight: 600;
    margin: 0 3px;
    transition: all 0.3s;
}

.wiki-tag:hover {
    background: rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Quotes */
.wiki-quote {
    border-left: 4px solid var(--accent-main);
    padding: 12px 18px;
    margin: 18px 0;
    background: rgba(0, 0, 0, 0.15);
    font-style: italic;
    color: var(--text-secondary);
    border-radius: 8px;
}

/* najważniejsze – zerujemy marginesy w środku */
.wiki-quote > *:first-child {
    margin-top: 0;
}
.wiki-quote > *:last-child {
    margin-bottom: 0;
}


/* Sidebar / Infobox */
.wiki-sidebar {
    float: right;
    width: 320px;
    margin: 0 0 20px 25px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-md);
}

.sidebar-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--accent-secondary);
    text-align: center;
}

.sidebar-content {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
}

.sidebar-row {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
}

.sidebar-row:last-child {
    border-bottom: none;
}

.sidebar-label {
    flex: 0 0 40%;
    font-weight: 600;
    color: var(--text-muted);
}

.sidebar-value {
    flex: 1;
    color: var(--text-primary);
}

/* Grid Layout */
.wiki-grid {
    display: grid;
    gap: 24px;
    margin: 25px 0;
    width: 100%;
}

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

.wiki-grid-item {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
}

/* Lists */
ul, ol {
    margin: 20px 0;
    padding-left: 30px;
}

ul li, ol li {
    color: var(--text-primary);
}

ul li::marker {
    color: var(--accent-main);
}

ol li::marker {
    color: var(--accent-main);
    font-weight: 700;
}

/* Meta informacje, daty, autorzy */
.meta,
.page-meta,
.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Tytuły sekcji typu „Powiązane strony” */
.related-title,
.related-header {
    font-size: 18px;
    font-weight: 700;
    margin: 30px 0 12px;
    color: var(--text-secondary);
}

/* Kontener listy powiązanych */
.related-list,
.related-pages {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Element listy powiązanych stron */
.related-list li,
.related-pages li {
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    margin-bottom: 8px;
    transition: all 0.2s;
}

.related-list li a,
.related-pages li a {
    color: var(--text-primary);
    text-decoration: none;
}

.related-list li:hover,
.related-pages li:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}


/* Ogólna lista stron */
.page-list {
    list-style: none;
    margin: 20px 0;
    padding: 0;
}

.page-list li {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 10px;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.page-list li:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Tytuł strony w liście */
.page-list-title {
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
}


/* Nagłówek sekcji / hero box */
.page-hero,
.page-header-box {
    background: var(--card-bg);
    border-radius: 18px;
    border: 1px solid var(--border-color);
    padding: 24px 30px;
    box-shadow: var(--shadow-md);
    margin-bottom: 25px;
}

.page-hero-title,
.page-header-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-secondary);
}

.page-hero-subtitle,
.page-header-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Małe przyciski tekstowe / linki nawigacyjne */
.nav-links a {
    color: var(--text-secondary);
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
    transition: all 0.2s;
}

.nav-links a:hover {
    color: var(--accent-hover);
    border-color: var(--accent-main);
}

/* Ogólny „notice” / info box (np. na górze strony) */
.notice,
.notice-box {
    background: var(--info-bg);
    border-left: 4px solid var(--info-border);
    color: var(--info-text);
    padding: 14px 18px;
    border-radius: 10px;
    margin: 15px 0;
    font-size: 14px;
}


/* Wiersze meta w listach stron */
.page-list-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}


/* Responsive */
@media (max-width: 1024px) {
    .wiki-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .wiki-sidebar {
        float: none;
        width: 100%;
        margin: 20px 0;
    }
}

@media (max-width: 768px) {
    .wiki-grid,
    .wiki-grid-2,
    .wiki-grid-3,
    .wiki-grid-4 {
        grid-template-columns: 1fr !important;
    }

    .wiki-image-left,
    .wiki-image-right {
        float: none;
        margin: 20px auto;
    }
}

/* WIKI BOXY */

.wiki-box {
    margin: 22px 0;
    padding: 16px 18px;
    border-radius: 10px;
    border-left: 3px solid var(--border-subtle);
    background-color: var(--bg-surface-alt);
}

.wiki-box-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.wiki-box-content {
    line-height: 1.6;
    color: var(--text-primary);
}

.wiki-box-tip {
    background-color: var(--card-bg-soft);
    border-left-color: var(--accent-main);
    color: var(--text-secondary);
}

/* DIVIDER WIKI */

.wiki-divider {
    border: none;
    height: 1px;
    margin: 24px 0;
    background-color: var(--border-subtle);
}

/* BREADCRUMBS WIKI */

.breadcrumbs {
    background: var(--card-bg);
    padding: 15px 30px;
    border-radius: 12px;
    margin: 20px auto;
    max-width: 1200px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.breadcrumbs a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: var(--link-hover);
}

.breadcrumbs .separator {
    color: var(--text-muted);
    opacity: 0.6;
}

.breadcrumbs .current {
    color: var(--text-secondary);
    font-weight: 600;
}


/* RELATED PAGES WIKI */

.related-pages {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--border-subtle);
}

.related-title {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

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

.related-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    padding: 12px 14px;
    text-decoration: none;
    display: block;
}

.related-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* KOMENTARZE WIKI */

.comments-section {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
}

.comments-section h3 {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.comment-form {
    background-color: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    padding: 18px 20px;
    margin-bottom: 20px;
}

.comment-form h4 {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background-color: var(--bg-surface-alt);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 90px;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--input-border-focus);
    box-shadow: 0 0 0 1px var(--input-border-focus);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.comments-list {
    margin-top: 20px;
}

.no-comments {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 18px;
}

/* META / PAGE STRUCTURE WIKI */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ===== INFOBOX (SZABLONY POSTACI) ===== */

.infobox {
    position: relative;  /* ZMIENIONE z float */
    float: right;
    width: 300px;
    max-width: 100%;
    margin: 0 0 20px 20px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    z-index: 10;  /* DODANE - żeby był nad treścią */
}

/* Kontener strony musi mieć overflow visible */
.page-content {
    position: relative;
    overflow: visible !important;  /* WAŻNE */
}

/* Wrapper dla całej zawartości strony z infoboxem */
.page-content::after {
    content: "";
    display: table;
    clear: both;
}

.infobox-header {
    background: linear-gradient(135deg, var(--accent-main), var(--accent-strong));
    color: #ffffff;
    padding: 14px 16px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

.infobox-image {
    width: 100%;
    background-color: var(--bg-surface-alt);
    border-bottom: 1px solid var(--border-subtle);
}

.infobox-image img {
    width: 100%;
    height: auto;
    display: block;
}

.infobox-section {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.infobox-section:last-child {
    border-bottom: none;
}

.infobox-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;  /* zmienione z center */
    padding: 6px 0;
    font-size: 13px;
    line-height: 1.4;
}

.infobox-label {
    font-weight: 600;
    color: var(--text-secondary);
    flex: 0 0 auto;
    margin-right: 10px;
    padding-top: 2px;  /* wyrównanie z pierwszą linią wartości */
}

.infobox-value {
    color: var(--text-muted);
    text-align: right;
    flex: 1;
    display: flex;
    align-items: flex-end;  /* zmienione z center */
    justify-content: flex-end;
    gap: 6px;
    flex-direction: row;  /* domyślnie poziomo */
}

/* Dowódcy w pionie z odstępami */
.infobox-value-dowodcy {
    display: flex;
    flex-direction: column;
    align-items: flex-end;  /* wyrównanie do prawej */
    gap: 4px;
}

.infobox-value-dowodcy a {
    line-height: 1.4;
}




.infobox-separator {
    background-color: var(--bg-surface-alt);
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.infobox-flag {
    width: 24px;
    height: auto;
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
}

.infobox-skills {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
}


/* Responsywność */
@media (max-width: 968px) {
    .infobox {
        float: none;
        width: 100%;
        max-width: 500px;
        margin: 0 auto 20px auto;
    }
}

@media (max-width: 768px) {
    .infobox {
        width: 100%;
        margin: 0 0 20px 0;
    }
}

/* Template error */
.template-error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    padding: 12px;
    color: #ef4444;
    font-size: 13px;
    margin: 10px 0;
}

/* ===== INFOBOX - SEKCJA UMIEJĘTNOŚCI ===== */

.infobox-skills-section {
    padding: 12px 16px !important;
}

.infobox-skill-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.infobox-skill-row:last-child {
    border-bottom: none;
}

.infobox-skill-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.infobox-skill-icon {
    width: auto;
    height: 32px;
    border-radius: 4px;
    /* border: 1px solid var(--border-subtle); */
    object-fit: contain;
}

/* Ikona w sekcji Nacja */
.infobox-icon {
    width: 32px;
    height: 32px;
    border-radius: 4px;
/*     border: 1px solid var(--border-subtle); */
    object-fit: contain;
}


.page-content {
    margin-top: 10px;
}

.page-meta {
    margin-top: 24px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    font-size: 13px;
    color: var(--text-muted);
}

/* KATEGORIE WIKI */

.page-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.category-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background-color: var(--bg-surface-alt);
    font-size: 12px;
    color: var(--text-secondary);
}

/* SIDEBAR DROBNIEJSZE DODATKI */

.sidebar-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 8px;
    color: var(--text-secondary);
    text-align: center;
}

.sidebar-content {
    font-size: 14px;
    color: var(--text-primary);
}

.sidebar-right {
    float: right;
    margin-left: 18px;
}

.sidebar-text-center {
    text-align: center;
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* CATEGORY PAGE */

.category-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-strong);
}

.category-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
}

.category-description {
    color: var(--text-secondary);
    font-size: 15px;
    margin-top: 10px;
    line-height: 1.5;
}

.category-stats {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

/* PAGE LIST – kafelki z linkiem */

.page-list {
    list-style: none;
    margin: 25px 0 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-list-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.page-list-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 16px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.page-list-item-link:hover .page-list-item {
    background-color: var(--card-bg-soft);
    border-color: var(--accent-main);
    transform: translateY(-2px);
}

.page-list-title {
    display: inline-block;
    font-weight: 700;
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.page-list-item-link:hover .page-list-title {
    color: var(--text-primary);
}

.page-list-desc {
    margin: 6px 0 8px 0;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

.page-list-tags {
    margin-bottom: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.page-lang-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    background-color: var(--info-bg);
    border: 1px solid var(--info-border);
    font-size: 11px;
    color: var(--info-text);
}

.page-meta {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Wielolinijkowe wartości w infobox */
.infobox-row-multiline {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 0;
}

.infobox-multiline-content {
    padding: 0 12px 8px 12px;
}

.infobox-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.infobox-list li {
    padding: 6px 0 6px 20px;
    position: relative;
    font-size: 0.9em;
    line-height: 1.5;
    color: var(--text-secondary, #e5e7eb);
}

.infobox-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-main, #8b5cf6);
    font-weight: bold;
    font-size: 1.2em;
}

.infobox-row-stacked {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    margin: 4px 8px;
}

.infobox-row-stacked .infobox-label {
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
}

.infobox-value-multi {
    width: 100%;
    font-size: 0.9em;
    line-height: 2;
    color: var(--text-secondary, #e5e7eb);
    padding-left: 0px;
    text-align: left;
}

.infobox-value-multi br {
    display: block;
    content: "";
    margin: 2px 0;
}

/* Opcja 2: Z ikonkami "→" */
.infobox-value-multi-icon {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.infobox-value-multi-icon .multi-line-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.infobox-value-multi-icon .multi-line-item:hover {
    background: rgba(139, 92, 246, 0.1);
    transform: translateX(4px);
}

.infobox-value-multi-icon .multi-line-item::before {
    content: '→';
    color: var(--accent-main, #8b5cf6);
    font-weight: bold;
    font-size: 1.1em;
}

.infobox-empty {
    color: var(--text-muted, #6b7280);
    font-style: italic;
}

/* Obrazki GIF obok siebie (inline) */
.wiki-image {
    display: inline-block;
    vertical-align: middle;
    margin: 0 5px 5px 0;
}

.wiki-image img {
    display: block;
    border: none;
    box-shadow: none;
}

/* Usuń ramki i cienie z wszystkich obrazków wiki */
.wiki-image figure, .wiki-image figcaption {
    border: none;
    text-align: center;
    box-shadow: none;
    background: transparent;
    padding: 0;
    margin: 0;
}

/* Dla małych gifów (jak ikony postaci) */
.wiki-image img[src$=".gif"] {
    width: auto !important;
    height: auto;
    border: none;
    box-shadow: none;
}


.wiki-table .wiki-image img {
    max-width: 64px !important;
    width: auto !important;
    height: auto;
    border: none;
    box-shadow: none;
}

/* ============================================
   PRZYCISKI NACJI - TABS
   ============================================ */

/* Kontener z przyciskami */
.nation-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

/* Styl przycisku */
.nation-tab {
    background: none;
    color: var(--text-primary);
    border: 2px solid var(--border-subtle);
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-sm);

    /* najważniejsze dla rozciągania */
    flex: 1 1 0;
    width: 100%;
}


.nation-tab:hover {
    background: var(--btn-primary-bg);
    border-color: var(--btn-primary-border);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    filter: brightness(1.2);
}

.nation-tab.active {
    background: var(--progress-fill);
    border-color: var(--accent-hover);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
}

.nation-tab img {
    max-width: 64px; --32
    height: auto;
    vertical-align: middle;
}

/* Zawartość zakładek */
.nation-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.nation-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   KATEGORIE NA STRONIE GŁÓWNEJ
   ============================================ */

.home-categories {
    margin: 50px 0;
}

.category-section {
    margin-bottom: 40px;
}

.category-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.category-card {
    background: var(--card-bg);
    border: 2px solid var(--border-subtle);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-sm);
}

.category-card:hover {
    border-color: var(--accent-hover);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    background: var(--card-bg-soft);
}

.category-icon {
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border-radius: 50%;
    padding: 10px;
    transition: transform 0.3s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

.category-icon img {
    min-width: 100px;
    min-height: 100px;
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
}

.category-name {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Responsywność */
@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }
    
    .category-icon {
        width: 100px;
        height: 100px;
    }
    
    .category-name {
        font-size: 14px;
    }
}

/* Obrazek po prawej z podpisem */
.right-image-box {
    float: right;
    width: 40%;
    max-width: 520px;
    margin: 0 0 20px 30px;
    clear: right;   /* to jest klucz */
}


.right-image-inner {
    background: var(--card-bg);
    border: 2px solid var(--border-subtle);
    border-radius: 8px;
    padding: 6px;
    box-shadow: var(--shadow-sm);
}

.right-image-inner img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.right-image-caption {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
}

/* Na telefonach – obrazek pod tekstem, na pełną szerokość */
@media (max-width: 900px) {
    .right-image-box {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 20px 0;
    }
}


/* Kontener spisu treści */
.wiki-toc {
    margin: 24px 0;
    padding: 14px 16px;
    border-radius: 10px;

    background: radial-gradient(circle at top left,
                rgba(255, 255, 255, 0.06),
                rgba(0, 0, 0, 0.65));
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.80);

    font-size: 14px;
    color: var(--text-primary);
}

/* Tytuł */
.wiki-toc > strong {
    display: flex;
    align-items: center;
    gap: 6px;

    margin-bottom: 10px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

/* Lista pozycji */
.wiki-toc ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wiki-toc li {
    margin: 2px 0;
}

/* Wcięcia poziomów nagłówków (dopasuj do klas z JS) */
.wiki-toc li.level-1 { padding-left: 0; }
.wiki-toc li.level-2 { padding-left: 14px; }
.wiki-toc li.level-3 { padding-left: 28px; }

/* Linki */
.wiki-toc a {
    display: block;
    padding: 2px 0 2px 6px;

    color: var(--text-primary);
    text-decoration: none;
    border-left: 2px solid transparent;

    transition: color 0.15s ease,
                border-color 0.15s ease,
                background 0.15s ease,
                transform 0.08s ease;
}

.wiki-toc a:hover {
    color: var(--accent-main);
    border-left-color: var(--accent-main);
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(2px);
}

/* Na wąskich ekranach – pełna szerokość, mniejszy cień */
@media (max-width: 900px) {
    .wiki-toc {
        margin: 16px 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    }
}

.characters-page h1 {
    text-align: center;
    margin-bottom: 16px;
}

/* Taby już masz – ewentualnie tylko odstęp */
.characters-page .nation-tabs {
    justify-content: center;
    margin-bottom: 18px;
}

/* Kontenery nacji */
.nation-content {
    display: none;
    padding: 18px 20px;
    border-radius: 10px;
    /*background: rgba(0, 0, 0, 0.55);*/
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.nation-content.active {
    display: block;
}

.nation-content > h2 {
    text-align: center;
    margin: 0 0 14px;
    font-size: 16px;
}

/* Grid portretów */
.character-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0px;
    justify-content: center;   /* rzędy będą wyśrodkowane */
}

.character-grid .char-card {
    width: 150px;              /* lub ile tam masz */
    text-align: center;
}

.character-name {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}


/* Jeśli character-card generuje np. .character-card */
.character-card {
    text-align: center;
    font-size: 13px;
}

.character-card img {
    display: block;
    object-fit: cover;
    margin: 0 auto 4px;
}

.char-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;          /* odstęp między portretami */
    justify-content: center;
}

.char-grid .char-card {  /* klasa na wrappera wewnątrz {{char}} */
    width: 150px;        /* szerokość jednego portretu */
    text-align: center;
}

.wiki-map {
    position: relative;
    width: min(100%, var(--map-w, 800px));
    aspect-ratio: calc(var(--map-w, 800) / var(--map-h, 600));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin: 1.5rem 0;
    border: 1px solid rgba(255,255,255,0.2);
}

.wiki-map-point {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, z-index 0s;
    z-index: 1;
}

.wiki-map-point:hover {
    transform: translate(-50%, -50%) scale(1.15);
    z-index: 10;
}

.wiki-map-point .wiki-symbol {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.8));
    transition: filter 0.15s ease;
}

.wiki-map-point:hover .wiki-symbol {
    filter: drop-shadow(0 0 6px rgba(0,255,255,1));
}

/* wersja stała – pod ikoną */
.wiki-map-label {
    position: absolute;
    top: 115%;            /* pod ikoną */
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(5, 15, 25, 0.8);
    color: #fff;
    font-size: 10px;
    white-space: nowrap;
    opacity: 1;
    pointer-events: none;
}


.wiki-back-button {
    margin: 0 0 1rem;
}

.wiki-back-button a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 4px;
    background: var(--card-bg);
    color: #fff;
    font-size: 13px;
    text-decoration: none;
}

.wiki-back-button a:hover {
    background: var(--card-bg-soft);
}

.wiki-back-button .wiki-symbol {
    width: auto;
}

.mod-card {
    display: flex;
    gap: 16px;
    padding: 14px 16px;
    margin: 12px 0;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.mod-card-thumb img {
    display: block;
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 6px;
}

.mod-card-body {
    flex: 1;
    min-width: 0;
}

.mod-card-title {
    margin-top: 5px !important;
    margin-bottom: 10px !important;
    /* margin: 0 0 4px; */
    font-size: 1rem;
}

.mod-card-title-link {
    color: var(--accent-main);
    text-decoration: none;
}
.mod-card-title-link:hover {
    text-decoration: underline;
}

.mod-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 10px;
    margin-bottom: 10px;
}

.mod-card-author {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.infobox-baza .infobox-header {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.infobox-baza .infobox-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.infobox-baza .infobox-flag {
    width: 32px;
    height: auto;
    vertical-align: middle;
}


.infobox-baza .infobox-row-nacja .infobox-value-nacja {
    display: flex;
    align-items: center;
}

.infobox-baza .infobox-value-nacja .wiki-symbol {
    width: 48px;
    height: 48px;
}

.infobox-image-multi {
    position: relative;
    overflow: hidden;
}

.infobox-image-multi img {
    display: block;
    width: 100%;
    height: auto;
}

.infobox-image-tabs {
    display: flex;
    gap: 6px;
    padding: 6px 8px;
    background: var(--accent-main)
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.infobox-image-tab {
    flex: 0 0 auto;
    border: 0;
    padding: 4px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.infobox-image-tab.active {
    color: var(--accent-main);
    border-bottom: 2px solid var(--accent-main);
}


/* domyślne */
.lore-icon {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    object-fit: scale-down !important;
}

/* mniejsze ikony */
.icon-small {
    max-height: 60px !important;
}

/* większe ikony */
.icon-large {
    max-height: 120px !important;
}

.icon-main {
    max-height: 50px !important;
}

