/* ============================================================
   MisztalCMS – motyw corporate · nowoczesny redesign (2026)
   ============================================================ */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --accent: #7c3aed;
    --success: #10b981;
    --danger: #ef4444;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);

    --bg: #f5f6fa;
    --surface: #ffffff;
    --card: #ffffff;

    --text: #101828;
    --text-muted: #667085;
    --border: #e6e8f0;
    --border-strong: #d0d5e2;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;

    --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-sm: 0 2px 8px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 8px 28px rgba(16, 24, 40, 0.09);
    --shadow-lg: 0 18px 50px rgba(49, 46, 129, 0.16);
    --shadow-glow: 0 10px 30px rgba(99, 91, 255, 0.35);

    --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background:
        radial-gradient(900px 420px at 85% -80px, rgba(124, 58, 237, 0.07), transparent 60%),
        radial-gradient(700px 380px at -60px 30%, rgba(79, 70, 229, 0.06), transparent 55%),
        var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection { background: rgba(99, 91, 255, 0.25); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c7cbe0; border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #a9afce; }

img, video { max-width: 100%; height: auto; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid rgba(99, 91, 255, 0.45); outline-offset: 2px; border-radius: 6px; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- Sekcje i nagłówki ---------- */

.section { padding: 72px 0; }

.section-title {
    font-size: clamp(24px, 3.2vw, 34px);
    font-weight: 800;
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 48px;
    color: var(--text);
}

.page-title {
    font-size: clamp(26px, 3.6vw, 38px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin-bottom: 28px;
    color: var(--text);
}

.gradient-text,
.hero h1 .gradient-text {
    background: linear-gradient(90deg, #a78bfa 0%, #f0abfc 50%, #93c5fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.search-count { color: var(--text-muted); margin-bottom: 24px; font-size: 15px; }
.category-description { color: var(--text-muted); max-width: 720px; margin-bottom: 32px; font-size: 16px; }

/* ---------- Nagłówek strony (fallback gdy brak bloku w bazie) ---------- */

.site-header {
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 68px; }

.logo {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
}
.logo i {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--gradient);
    color: #fff;
    border-radius: 11px;
    font-size: 15px;
    box-shadow: var(--shadow-glow);
}

.nav-menu { display: flex; align-items: center; gap: 2px; list-style: none; }
.nav-menu a {
    color: var(--text);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14.5px;
    font-weight: 550;
    transition: background 0.2s, color 0.2s;
}
.nav-menu a:hover { background: rgba(79, 70, 229, 0.09); color: var(--primary); }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
}

.search-form { display: flex; gap: 6px; margin-left: 10px; }
.search-form input {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 14px;
    width: 190px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.search-form input::placeholder { color: #98a2b3; }
.search-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12); }
.search-form button {
    background: var(--gradient);
    color: #fff;
    border: none;
    width: 38px; height: 38px;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.search-form button:hover { transform: translateY(-1px); box-shadow: var(--shadow-glow); }

/* ---------- Hero (fallback) ---------- */

.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #4c1d95 100%);
    color: #fff;
    padding: 110px 24px 120px;
    text-align: center;
}
.hero::before, .hero::after { content: none; }
.hero-blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.45; pointer-events: none; }
.hero-blob-a { width: 480px; height: 480px; top: -220px; right: -120px; animation: floatBlob 11s ease-in-out infinite alternate; }
.hero-blob-b { width: 420px; height: 420px; bottom: -230px; left: -110px; animation: floatBlob 13s ease-in-out infinite alternate-reverse; }

@keyframes floatBlob {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(-40px, 30px, 0) scale(1.12); }
}

.hero > .container { position: relative; z-index: 1; }

.hero h1 {
    font-size: clamp(32px, 5.4vw, 56px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 18px;
}
.hero p {
    font-size: clamp(16px, 2vw, 19px);
    color: rgba(255, 255, 255, 0.82);
    margin: 0 auto 36px;
    max-width: 640px;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Przyciski ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 650;
    font-size: 14.5px;
    letter-spacing: 0.01em;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s, opacity 0.2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(99, 91, 255, 0.45); }

.btn-outline {
    background: transparent;
    color: currentColor;
    border: 1.5px solid currentColor;
}
.btn-outline:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.1); }

/* ---------- Siatka postów / karty ---------- */

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr));
    gap: 26px;
}

.post-card {
    position: relative;
    background: var(--card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.3, 1.2), box-shadow 0.28s, border-color 0.28s;
    display: flex;
    flex-direction: column;
}
.post-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.post-image { overflow: hidden; }
.post-image img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
    display: block;
}
.post-card:hover .post-image img { transform: scale(1.06); }

.post-content { padding: 24px; display: flex; flex-direction: column; flex: 1; }

.post-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.post-category {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(124, 58, 237, 0.12));
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
}

.post-content h2, .post-content h3 { margin-bottom: 10px; font-size: 20px; line-height: 1.35; letter-spacing: -0.01em; }
.post-content h2 a, .post-content h3 a { color: var(--text); text-decoration: none; transition: color 0.2s; }
.post-content h2 a:hover, .post-content h3 a:hover { color: var(--primary); }

.post-content p { color: var(--text-muted); font-size: 14.5px; line-height: 1.65; flex: 1; }

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.post-author { font-size: 13px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 6px; }

.read-more {
    color: var(--primary);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s;
}
.read-more:hover { gap: 10px; }

/* ---------- Strona wpisu / artykuł ---------- */

.article-header { margin-bottom: 36px; }
.article-header h1 {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin: 14px 0 18px;
    color: var(--text);
}
.article-meta {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 14px;
}
.article-meta i { color: var(--primary); margin-right: 5px; }

.article-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 36px;
    box-shadow: var(--shadow-md);
}
.article-image img { width: 100%; display: block; }

.article-content, .page-content {
    line-height: 1.85;
    font-size: 16.5px;
    color: #26303e;
}
.article-content h2, .article-content h3,
.page-content h2, .page-content h3 {
    margin: 36px 0 14px;
    color: var(--text);
    letter-spacing: -0.015em;
    font-weight: 750;
}
.article-content p, .page-content p { margin-bottom: 18px; }
.article-content img, .page-content img { border-radius: var(--radius); }
.article-content ul, .article-content ol,
.page-content ul, .page-content ol { margin: 0 0 18px; padding-left: 24px; }
.article-content li, .page-content li { margin-bottom: 6px; }
.article-content a, .page-content a { color: var(--primary); }
.article-content blockquote, .page-content blockquote {
    border-left: 3px solid var(--primary);
    background: rgba(79, 70, 229, 0.05);
    padding: 14px 20px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 0 0 18px;
    color: #374151;
}
.article-content table, .page-content table { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: 15px; }
.article-content th, .article-content td, .page-content th, .page-content td {
    border: 1px solid var(--border);
    padding: 10px 14px;
    text-align: left;
}
.article-content th, .page-content th { background: #fafbff; }

.article-tags { margin-top: 36px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.article-tags > i { color: var(--text-muted); }

.tag {
    display: inline-block;
    padding: 6px 14px;
    background: #fff;
    color: var(--text-muted);
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.tag:hover {
    background: var(--gradient);
    color: #fff;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.article-share {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px dashed var(--border-strong);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-muted);
}
.article-share a {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
}
.article-share a:hover {
    background: var(--gradient);
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* ---------- Komentarze ---------- */

.comments-section { margin-top: 56px; }
.comments-section h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 24px; }

.comment-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}
.comment-form h3 { margin-bottom: 14px; font-size: 17px; }

.comment, .panel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-xs);
}
.comment-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; font-size: 13px; color: var(--text-muted); }
.comment-author { font-weight: 700; color: var(--text); }

/* ---------- Formularze ---------- */

.auth-form {
    max-width: 460px;
    margin: 56px auto;
    padding: 44px 40px;
    background: var(--surface);
    border-radius: 22px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}
.auth-form h1 { margin-bottom: 24px; color: var(--text); font-size: 24px; letter-spacing: -0.02em; }

.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 13.5px;
    font-weight: 650;
    color: var(--text);
}
.form-group input,
.form-group textarea,
.form-group select,
.form-control {
    width: 100%;
    padding: 12px 16px;
    background: #f8f9fc;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.form-group textarea.form-control { resize: vertical; min-height: 110px; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus, .form-control:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-size: 14px;
    border: 1px solid transparent;
}
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* ---------- Sekcja funkcji (strona główna) ---------- */

.features-section { padding-top: 24px; }
.features-lead {
    text-align: center;
    color: var(--text-muted);
    max-width: 640px;
    margin: -30px auto 44px;
    font-size: 16.5px;
}
.gradient-text-dark {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr));
    gap: 22px;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 26px;
    box-shadow: var(--shadow-xs);
    transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.3, 1.2), box-shadow 0.25s, border-color 0.25s;
}
.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(79, 70, 229, 0.35);
}

.feature-icon {
    width: 52px; height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(124, 58, 237, 0.12));
    color: var(--primary);
    font-size: 21px;
    margin-bottom: 18px;
    transition: transform 0.25s, background 0.25s, color 0.25s, box-shadow 0.25s;
}
.feature-card:hover .feature-icon {
    background: var(--gradient);
    color: #fff;
    transform: scale(1.08) rotate(-4deg);
    box-shadow: var(--shadow-glow);
}

.feature-card h3 {
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
    color: var(--text);
}
.feature-card p { font-size: 14px; line-height: 1.65; color: var(--text-muted); }

/* ---------- Stany puste / 404 ---------- */

.empty-state {
    text-align: center;
    padding: 72px 24px;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
}
.empty-state i {
    font-size: 46px;
    margin-bottom: 18px;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.empty-state h3 { color: var(--text); margin-bottom: 6px; font-size: 18px; }

.error-page .error-content { text-align: center; padding: 60px 0; }
.error-code {
    font-size: clamp(96px, 18vw, 170px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.error-content h2 { font-size: 26px; margin: 12px 0 10px; letter-spacing: -0.02em; }
.error-content p { color: var(--text-muted); margin-bottom: 30px; }

/* ---------- Paginacja ---------- */

.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 48px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.pagination .active, .pagination span.active {
    background: var(--gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

/* ---------- Forum ---------- */

.forum-categories { display: grid; gap: 16px; }

.forum-category-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow-xs);
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.forum-category-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(79, 70, 229, 0.35); }
.forum-category-card h3 { margin-bottom: 4px; font-size: 18px; }
.forum-category-card h3 a { color: var(--text); text-decoration: none; transition: color 0.2s; }
.forum-category-card h3 a:hover { color: var(--primary); }
.forum-category-card p { color: var(--text-muted); font-size: 14px; }

.forum-stats { display: flex; gap: 26px; color: var(--text-muted); font-size: 13.5px; flex-wrap: wrap; white-space: nowrap; }
.forum-stats i { color: var(--primary); }

.ft-legend { display: flex; gap: 20px; align-items: center; margin-bottom: 16px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }
.ft-legend > span { display: inline-flex; align-items: center; gap: 8px; }

.ft-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
}

.ft-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.ft-table th {
    text-align: left;
    padding: 13px 16px;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    background: #fafbfe;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.ft-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ft-table tr:last-child td { border-bottom: none; }
.ft-table tbody tr { transition: background 0.15s; }
.ft-table tbody tr:hover { background: #f8f8ff; }

.ft-title { color: var(--text); font-weight: 650; text-decoration: none; font-size: 15px; }
.ft-title:hover { color: var(--primary); }

.ft-status {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 11px;
    font-size: 14px;
}
.ft-status--unread { background: linear-gradient(135deg, rgba(79, 70, 229, 0.14), rgba(124, 58, 237, 0.14)); color: var(--primary); }
.ft-status--read { background: #f2f4f7; color: #98a2b3; }

.ft-author { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; }
.ft-avatar {
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.ft-meta-badge {
    display: inline-block;
    min-width: 30px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #f2f4f7;
    color: var(--text);
    font-size: 12.5px;
    font-weight: 700;
    text-align: center;
}
.ft-new-pill {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--gradient);
    color: #fff;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
    box-shadow: var(--shadow-glow);
}
.ft-last strong { color: var(--text); }

.rp-slide > div { transition: transform 0.2s, box-shadow 0.2s; }

/* ---------- Panel użytkownika / profil ---------- */

.up-hero {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
    border-radius: 24px;
    padding: 44px 40px;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-bottom: 28px;
}
.up-hero::after {
    content: "";
    position: absolute;
    width: 340px; height: 340px;
    border-radius: 50%;
    background: #7c3aed;
    filter: blur(90px);
    opacity: 0.4;
    top: -160px; right: -80px;
}

.up-avatar {
    width: 84px; height: 84px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    font-size: 34px;
    font-weight: 800;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}

.up-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin: 28px 0; }
.up-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    text-align: center;
    box-shadow: var(--shadow-xs);
    transition: transform 0.2s, box-shadow 0.2s;
}
.up-stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.up-stat b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; background: var(--gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.up-stat span { color: var(--text-muted); font-size: 13px; font-weight: 600; }

.up-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.up-card__head { font-size: 18px; font-weight: 750; letter-spacing: -0.015em; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.up-row { padding: 12px 0; border-bottom: 1px dashed var(--border); font-size: 14.5px; }
.up-row:last-child { border-bottom: none; }

/* ---------- Edytor BBCode / shoutbox ---------- */

.sb-editor, .sb-editor-body { width: 100%; }
.sb-editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; }

#toTop {
    position: fixed;
    right: 26px;
    bottom: 26px;
    width: 48px; height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--gradient);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
    z-index: 900;
}
#toTop.visible { opacity: 1; visibility: visible; transform: translateY(0); }
#toTop:hover { transform: translateY(-3px); }

/* ---------- Animacje wejścia ---------- */

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}

/* ---------- Stopka (fallback) ---------- */

.footer-nav { display: flex; justify-content: center; gap: 26px; margin-bottom: 16px; flex-wrap: wrap; }
.footer-nav a { color: inherit; text-decoration: none; font-size: 14px; opacity: 0.8; transition: opacity 0.2s; }
.footer-nav a:hover { opacity: 1; }

.site-footer { background: #14142b; color: rgba(255, 255, 255, 0.75); padding: 40px 0; text-align: center; font-size: 14px; }

/* ---------- Layout z sidebarem ---------- */

.mcs-article-col { min-width: 0; }

/* ---------- Responsywność ---------- */

@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        padding: 14px 18px 20px;
        gap: 2px;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 24px 48px rgba(16, 24, 40, 0.14);
    }
    .nav-menu.open { display: flex; }
    .search-form { margin: 10px 0 4px; }
    .search-form input { width: 100%; flex: 1; }
}

@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .section { padding: 52px 0; }
    .hero { padding: 76px 20px 84px; }
    .hero-actions .btn { width: 100%; max-width: 320px; }
    .posts-grid { grid-template-columns: 1fr; }
    .auth-form { margin: 28px auto; padding: 30px 24px; }
    .pagination { flex-wrap: wrap; }
    .up-hero { padding: 32px 24px; }
    #toTop { right: 16px; bottom: 16px; }
}

@media (max-width: 640px) {
    .forum-category-card { flex-direction: column; align-items: flex-start; gap: 12px; }
    .forum-stats { gap: 16px; }
    .ft-hide-sm { display: none !important; }
    .rp-slide > div { padding: 12px 46px !important; }
    #rp-prev, #rp-next { width: 30px !important; height: 30px !important; font-size: 11px !important; }
    #rp-prev { left: 8px !important; }
    #rp-next { right: 8px !important; }
    #reply-editor { padding: 12px !important; font-size: 15px; }
    .ed-bar { padding: 6px !important; }
    .xf-head { flex-wrap: wrap; }
}
