/* ============================================================
   ZMIENNE GLOBALNE
   ============================================================ */
:root {
    --bg: #050505; 
    --panel: #0f0f0f; 
    --red: #cc0000; 
    --green: #00cc44; 
    --gold: #ffb020; 
    --blue: #00ccff;
    --text: #e0e0e0; 
    --muted: #888; 
    --border: #222;
    --font-head: 'Chakra Petch', sans-serif; 
    --font-mono: 'Share Tech Mono', monospace; 
    --font-body: 'Inter', sans-serif;
    --radius: 8px;
}

/* ============================================================
   RESET I PODSTAWY
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; scrollbar-width: thin; scrollbar-color: #333 #000; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    background-image: 
        linear-gradient(rgba(255,0,0,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,0,0,.03) 1px, transparent 1px);
    background-size: 30px 30px;
    overflow-x: hidden;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.container { max-width: 1000px; margin: 0 auto; padding: 20px; }
code { font-family: var(--font-mono); background: #1a1a1a; padding: 1px 5px; border-radius: 4px; color: var(--green); font-size: 0.9em; }
h1, h2, h3 { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 1px; line-height: 1.15; }
.page-title { font-size: 2.2rem; text-align: center; margin-bottom: 5px; }
.page-subtitle { font-family: var(--font-mono); text-align: center; color: var(--muted); margin-bottom: 40px; font-size: 0.9rem; }
#site-logo { max-height: 50px; width: auto; object-fit: contain; display: block; margin: 0 auto 20px auto; }

/* ============================================================
   A11Y I SELEKCJA
   ============================================================ */
:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}
::selection {
    background: var(--red);
    color: #fff;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ============================================================
   SCROLL PROGRESS
   ============================================================ */
#scroll-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0;
    background: linear-gradient(90deg, var(--red), var(--green));
    z-index: 2000; transition: width .1s linear;
    box-shadow: 0 0 10px rgba(255,0,0,.6);
}

/* ============================================================
   ANIMACJE (REVEAL)
   ============================================================ */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s cubic-bezier(.5,0,0,1), transform .8s cubic-bezier(.5,0,0,1); }
.reveal.active { opacity: 1; transform: none; }
.delay-1 { transition-delay: .1s; } .delay-2 { transition-delay: .2s; } .delay-3 { transition-delay: .3s; }

/* ============================================================
   NAWIGACJA
   ============================================================ */
.navbar {
    position: fixed; top: 0; width: 100%; z-index: 1000;
    background: rgba(5,5,5,.9); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.nav-content { display: flex; justify-content: space-between; align-items: center; height: 70px; }
.brand { font-family: var(--font-head); font-size: 24px; font-weight: 700; display: flex; align-items: center; gap: 4px; text-decoration: none; }
.logo-red { color: #ff0000; text-shadow: 0 0 8px rgba(255,0,0,.8); }
.logo-green { color: #38ff00; text-shadow: 0 0 8px rgba(56,255,0,.8); }
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { font-family: var(--font-mono); font-size: 14px; color: var(--muted); transition: color .3s; }
.nav-links a:hover { color: var(--text); }
.btn-nav { border: 1px solid var(--red); padding: 8px 16px; border-radius: var(--radius); color: var(--text) !important; }

/* ============================================================
   OGŁOSZENIA
   ============================================================ */
#global-ann-bar { background: #000; border-bottom: 1px solid var(--border); padding: 10px 0; margin-bottom: 20px; }
.ann-item { background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--red); border-radius: var(--radius); padding: 15px 20px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.ann-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed #333; padding-bottom: 10px; }
.ann-author { display: flex; align-items: center; gap: 10px; font-weight: bold; color: var(--text); font-family: var(--font-head); }
.ann-author img { width: 24px; height: 24px; border-radius: 50%; }
.ann-meta { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); display: flex; gap: 15px; }
.ann-timer { color: var(--red); font-weight: bold; }
.ann-content { font-size: 0.95rem; line-height: 1.7; color: #ddd; }
.ann-content p { margin-bottom: 8px; } .ann-content p:last-child { margin-bottom: 0; }
.ann-banner { width: 100%; max-height: 250px; object-fit: cover; border-radius: 4px; margin-top: 10px; border: 1px solid var(--border); }

/* PRIORYTETOWE OGŁOSZENIA (KAFELEK) */
.priority-ann-item { background: rgba(0, 204, 255, 0.1); border: 1px solid var(--blue); border-radius: var(--radius); padding: 15px; margin-bottom: 20px; cursor: pointer; transition: all 0.2s; }
.priority-ann-item:hover { background: rgba(0, 204, 255, 0.2); }
.priority-ann-item h3 { color: var(--blue); margin-bottom: 5px; display: flex; align-items: center; gap: 10px; font-size: 1.1rem; }
.priority-ann-item p { font-size: 0.9rem; color: #ccc; }

/* WIELU AUTORÓW - NAKŁADAJĄCE SIĘ AWATARY */
.author-avatars { display: flex; align-items: center; }
.author-avatars img { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--panel); margin-left: -10px; position: relative; }
.author-avatars img:first-child { margin-left: 0; }
.ann-author:hover .author-avatars img { margin-left: -4px; transition: margin-left 0.2s ease; }
.ann-author:hover .author-avatars img:first-child { margin-left: 0; }

/* ============================================================
   PRZYCISKI
   ============================================================ */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; font-family: var(--font-head); font-weight: 700; text-transform: uppercase; border: 1px solid transparent; border-radius: var(--radius); cursor: pointer; transition: background .2s, box-shadow .2s, transform .2s, border-color .2s; font-size: 0.85rem; text-align: center; }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 0 10px rgba(255,0,0,0.3); }
.btn-primary:hover { background: #990000; box-shadow: 0 0 20px rgba(255,0,0,0.6); transform: translateY(-2px); text-decoration: none; }
.btn-primary:active { box-shadow: 0 0 8px rgba(255,0,0,.4); }
.btn-outline { border-color: var(--border); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--green); color: var(--green); text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 0.75rem; }
.btn-discord { background: #5865F2; color: #fff; border: none; }
.btn-discord:hover { background: #4752C4; text-decoration: none; transform: translateY(-2px); }

/* ============================================================
   REGULAMIN
   ============================================================ */
.rules-container { background: var(--panel); padding: 30px; border: 1px solid var(--border); border-radius: var(--radius); }
.rule-category { margin-bottom: 30px; }
.rule-category:last-child { margin-bottom: 0; }
.rule-category h3 { color: var(--red); border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 15px; font-size: 1.3rem; }
.rule-line { font-size: 0.95rem; color: #ccc; padding: 8px 0; border-bottom: 1px dashed #222; display: flex; gap: 10px; }
.rule-line:last-child { border-bottom: none; }
.rule-line::before { content: '>'; color: var(--green); font-weight: bold; font-family: var(--font-mono); }

/* ============================================================
   SERWERY
   ============================================================ */
.server-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-bottom: 40px; }
.server-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; transition: transform .2s, border-color .2s, opacity .2s; overflow: hidden; position: relative; }
.server-card:hover { transform: translateY(-3px); border-color: #444; }
.server-card.maintenance { opacity: 0.6; filter: grayscale(0.8); }
.server-card.maintenance .server-banner { filter: brightness(0.5); }
.server-card.maintenance::after {
    content: 'TRWAJĄ PRACE';
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--gold); color: #000;
    padding: 8px 20px; font-weight: bold; font-family: var(--font-head);
    border-radius: 4px; z-index: 10; font-size: 1.1rem;
    box-shadow: 0 0 15px rgba(255,176,32,0.6);
}
.server-banner { width: 100%; height: 140px; object-fit: cover; display: block; border-bottom: 1px solid var(--border); }
.server-info { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.server-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; gap: 10px; flex-wrap: wrap; }
.server-title-group { display: flex; align-items: center; gap: 15px; }
.server-thumbnail { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: #222; flex-shrink: 0; border: 1px solid #333; }
.server-name { font-family: var(--font-head); font-size: 1.2rem; }
.server-status { padding: 3px 10px; border-radius: 4px; font-size: 0.75rem; font-family: var(--font-mono); font-weight: bold; text-transform: uppercase; white-space: nowrap; }
.status-active { color: var(--green); border: 1px solid var(--green); background: rgba(0,255,0,0.05); }
.status-wip { color: var(--gold); border: 1px solid var(--gold); background: rgba(255,176,32,0.05); }
.status-light-wip { color: var(--blue); border: 1px solid var(--blue); background: rgba(0,204,255,0.05); }
.status-offline { color: var(--red); border: 1px solid var(--red); background: rgba(255,0,0,0.05); }
.server-ip-box { display: flex; gap: 10px; margin-bottom: 15px; }
.server-ip-box input { background: #000; border: 1px solid var(--border); color: var(--green); padding: 8px 12px; font-family: var(--font-mono); border-radius: 4px; width: 100%; outline: none; }

/* ============================================================
   PREMIUM
   ============================================================ */
.premium-wrapper { display: flex; flex-wrap: wrap; gap: 30px; justify-content: center; margin-bottom: 50px; }
.premium-card { width: 100%; max-width: 380px; background: #090909; border: 1px solid var(--border); border-radius: var(--radius); padding: 35px; position: relative; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.premium-card.vip { border-top: 3px solid var(--gold); }
.premium-card.svip { border-top: 3px solid var(--red); }
.premium-title { font-family: var(--font-head); font-size: 2rem; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 1px; }
.premium-card.vip .premium-title { color: var(--gold); text-shadow: 0 0 15px rgba(255,176,32,0.3); }
.premium-card.svip .premium-title { color: var(--red); text-shadow: 0 0 15px rgba(255,0,0,0.3); }
.premium-price { font-family: var(--font-mono); font-size: 1.2rem; color: var(--text); margin-bottom: 25px; padding-bottom: 25px; border-bottom: 1px dashed var(--border); }
.premium-list { list-style: none; font-size: 0.95rem; }
.premium-list li { margin-bottom: 15px; padding-left: 25px; position: relative; color: #ccc; line-height: 1.5; }
.premium-list li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: bold; font-family: var(--font-mono); }
.premium-list ul { list-style: none; margin-top: 8px; margin-left: 0; font-size: 0.85rem; color: var(--muted); }
.premium-list ul li { padding-left: 14px; margin-bottom: 6px; }
.premium-list ul li::before { content: '■'; color: var(--red); font-size: 0.6rem; top: 4px; left: 0; }
#premium-supporters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; max-width: 800px; margin: 0 auto; }
#premium-supporters-grid .role-card { border-top: 3px solid var(--gold); }
#premium-supporters-grid .role-header { justify-content: center; color: var(--gold); font-size: 1.1rem; letter-spacing: 1px; }

/* ============================================================
   REKRUTACJE
   ============================================================ */
.rec-grid { display: flex; flex-direction: column; gap: 20px; }
.rec-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); border-left: 4px solid var(--green); padding: 25px; }
.rec-title { font-family: var(--font-head); font-size: 1.4rem; margin-bottom: 10px; }
.rec-desc { color: #ccc; margin-bottom: 20px; font-size: 0.95rem; line-height: 1.7; }

/* ============================================================
   CHANGELOG
   ============================================================ */
.changelog-list { display: flex; flex-direction: column; gap: 15px; }
.changelog-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 25px; cursor: pointer; transition: border-color .2s; }
.changelog-card:hover { border-color: var(--red); }
.changelog-meta { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted); margin-bottom: 15px; flex-wrap: wrap; gap: 10px; }
.changelog-content h1, .changelog-content h2, .changelog-content h3 { color: var(--green); margin-top: 20px; margin-bottom: 10px; }
.changelog-content p { margin-bottom: 12px; font-size: 0.95rem; }
.changelog-content ul, .changelog-content ol { margin-top: 10px; margin-bottom: 15px; padding-left: 24px; margin-left: 0; }
.changelog-content li { margin-bottom: 8px; line-height: 1.6; font-size: 0.95rem; padding-left: 4px; }
.changelog-content li p { margin-bottom: 0; }

/* ============================================================
   ADMIN TEAM / EKIPA
   ============================================================ */
#team-grid, #discord-team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.role-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; border-top: 3px solid var(--role-color, var(--red)); }
.role-header { display: flex; align-items: center; margin-bottom: 15px; border-bottom: 1px solid var(--border); padding-bottom: 10px; font-family: var(--font-head); font-size: 1.05rem; color: var(--text); }
.member { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 6px; border-radius: 4px; background: rgba(255,255,255,0.04); }
.member img { width: 32px; height: 32px; border-radius: 50%; }

/* ============================================================
   OWNER ACTIONS (Wspólna logika dla wszystkich sekcji)
   ============================================================ */
.owner-actions { display: none; gap: 10px; }
body.is-owner .owner-actions { display: flex; }

/* Kontekstowe style dla poszczególnych miejsc */
.ann-item .owner-actions { justify-content: flex-end; margin-top: 10px; }
.priority-ann-item .owner-actions { position: absolute; top: 15px; right: 15px; margin-top: 0; justify-content: flex-start; }
.server-info .owner-actions { margin-top: auto; border-top: 1px solid var(--border); padding-top: 15px; }
.rec-card .owner-actions { border-top: 1px solid var(--border); padding-top: 15px; }
.changelog-card .owner-actions { margin-top: 10px; }

/* ============================================================
   MODAL I TOAST (Dodano animację wejścia)
   ============================================================ */
.modal-backdrop { 
    display: flex; position: fixed; inset: 0; background: rgba(0,0,0,.85); backdrop-filter: blur(5px); 
    z-index: 10000; align-items: center; justify-content: center; padding: 15px; 
    opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; 
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal-content { 
    background: var(--panel); border: 1px solid var(--border); border-top: 3px solid var(--red); 
    border-radius: var(--radius); padding: 30px; width: 100%; max-width: 600px; max-height: 90vh; 
    overflow-y: auto; transform: translateY(10px) scale(.98); transition: transform .2s; 
}
.modal-backdrop.open .modal-content { transform: none; }
.modal-content h2 { font-family: var(--font-head); color: var(--red); margin-bottom: 20px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-family: var(--font-mono); font-size: 0.85rem; margin-bottom: 8px; color: var(--text); }
.form-group input, .form-group textarea, .form-group select { width: 100%; background: #050505; border: 1px solid var(--border); padding: 12px; color: #fff; border-radius: 4px; font-family: var(--font-body); font-size: 0.95rem; }
.form-group input[type="file"] { padding: 8px; font-family: var(--font-mono); font-size: 0.85rem; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 2px rgba(255,0,0,0.2); }
.modal-actions { display: flex; gap: 10px; margin-top: 25px; }
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 11000; display: flex; flex-direction: column; gap: 10px; }
.toast { background: #000; border: 1px solid var(--green); color: #fff; padding: 12px 20px; border-radius: var(--radius); font-family: var(--font-mono); font-size: 0.9rem; }

/* ============================================================
   PŁYWAJĄCY PRZYCISK WRÓĆ I LOGOWANIE
   ============================================================ */
.floating-back-btn { position: fixed; top: 20px; left: 20px; z-index: 9999; background: var(--panel); border: 1px solid var(--border); color: var(--text); padding: 10px 20px; border-radius: var(--radius); font-family: var(--font-head); text-transform: uppercase; text-decoration: none; transition: all 0.2s ease; box-shadow: 0 4px 15px rgba(0,0,0,0.5); }
.floating-back-btn:hover { border-color: var(--green); color: var(--green); text-decoration: none; transform: translateY(-2px); }

.global-auth-widget { position: fixed; top: 20px; right: 20px; z-index: 9999; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 12px; display: flex; align-items: center; gap: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.5); font-family: var(--font-mono); font-size: 0.85rem; }
.auth-btn { background: var(--green); color: #000; padding: 8px 16px; border-radius: 4px; font-weight: bold; text-decoration: none; font-family: var(--font-head); transition: 0.2s; }
.auth-btn:hover { background: #00aa33; text-decoration: none; transform: translateY(-2px); }
.auth-user { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: bold; }
.auth-user img { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--green); }
.auth-link { color: var(--red); text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

/* Poprawka dla stron z navbarem (przesunięcie widgetów w dół) */
body.has-navbar .floating-back-btn,
body.has-navbar .global-auth-widget {
    top: 85px;
}

/* ============================================================
   STYLE LINKÓW W TREŚCIACH (Markdown)
   ============================================================ */
.ann-content a, .modal-content a, .changelog-content a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; transition: color 0.2s; }
.ann-content a:hover, .modal-content a:hover, .changelog-content a:hover { color: #fff; background: rgba(0, 255, 0, 0.15); border-radius: 2px; }

/* ============================================================
   RESPONSYWNOŚĆ
   ============================================================ */
@media (max-width: 768px) {
    .page-title { font-size: 1.8rem; }
    .rules-container { padding: 20px; }
    .rule-line { font-size: 0.9rem; }
    .premium-card { max-width: 100%; padding: 25px; }
    .premium-title { font-size: 1.6rem; }
    .server-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .server-title-group { width: 100%; }
    .server-status { align-self: flex-start; }
    .modal-content { padding: 20px; }
    #site-logo { max-height: 40px; }
    .global-auth-widget { top: 10px; right: 10px; padding: 4px 8px; font-size: 0.75rem; }
    .auth-user span { display: none; }
    .floating-back-btn { top: 10px; left: 10px; padding: 6px 12px; font-size: 0.75rem; }
    body.has-navbar .floating-back-btn,
    body.has-navbar .global-auth-widget { top: 80px; }
}

/* ============================================================
   LIVE STATUS SERWERA GRY
   ============================================================ */
.live-status {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    width: fit-content;
    margin: 20px auto 15px;
    gap: 12px;
    text-align: left;
}

.live-status-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    transition: color 0.3s;
}

/* Kolor dla tekstu w zależności od stanu kropki (używa :has) */
.live-status-header:has(.live-dot.online)  { color: var(--green); }
.live-status-header:has(.live-dot.offline) { color: var(--red); }

.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--muted);
    box-shadow: 0 0 0 0 rgba(136,136,136,.7);
    flex-shrink: 0;
}

.live-dot.online {
    background: var(--green);
    box-shadow: 0 0 10px var(--green);
    animation: pulse-green 2s infinite;
}

.live-dot.offline {
    background: var(--red);
    box-shadow: 0 0 10px var(--red);
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(0,255,0,.7); }
    70% { box-shadow: 0 0 0 10px rgba(0,255,0,0); }
    100% { box-shadow: 0 0 0 0 rgba(0,255,0,0); }
}

.live-status-body {
    display: flex;
    gap: 25px;
    justify-content: space-between;
    border-top: 1px dashed var(--border);
    padding-top: 12px;
}

.live-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.live-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--muted);
    letter-spacing: 1px;
}

.live-value {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--text);
    font-weight: bold;
}

.status-full {
    color: var(--red);
    border: 1px solid var(--red);
    background: rgba(255,0,0,0.2);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255,0,0,0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255,0,0,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,0,0,0); }
}

@media (max-width: 480px) {
    .live-status { width: 100%; min-width: 0; }
}

/* ============================================================
   DOSTĘPNOŚĆ - OGRANICZENIE ANIMACJI
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}