@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Dymek (tooltip) bibliotekowy — element wisi w <body>, więc jego style MUSZĄ być globalne.
   Wcześniej CSS był w <style> wewnątrz treści strony (#mid) i znikał przy nawigacji SPA,
   przez co element zostawał jako "goły" tekst w lewym dolnym rogu strony. */
.tibian-custom-tooltip {
    position: fixed;
    z-index: 100000;
    background: rgba(13, 8, 20, 0.95);
    backdrop-filter: blur(4px);
    border: 1px solid #b026ff;
    box-shadow: 0 0 15px rgba(176, 38, 255, 0.4), inset 0 0 10px rgba(0,0,0,0.8);
    color: #e2e8f0;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 11px;
    font-family: inherit;
    pointer-events: none;
    max-width: 280px;
    line-height: 1.4;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.tibian-custom-tooltip.visible {
    opacity: 1;
    transform: scale(1);
}

html {
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: rgba(168, 85, 247, 0.6) #0b0b0d; /* Firefox: kolor suwaka i tła */
}

body {
    background-color: #000000;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(168, 85, 247, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(57, 255, 20, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 80% 15%, rgba(57, 255, 20, 0.05) 0%, transparent 35%),
        radial-gradient(circle at 20% 85%, rgba(168, 85, 247, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.04) 0%, transparent 60%);
    background-attachment: fixed;
    font-family: 'Inter', sans-serif;
    color: #f1f5f9; /* Jaśniejszy tekst dla lepszego czytania */
    position: relative; /* Potrzebne do pozycjonowania pseudo-elementów */
    overflow-x: hidden; /* Zapobiega pojawieniu się paska przewijania */
}

/* Akcenty po bokach strony */
body::before,
body::after {
    content: '';
    position: fixed;
    top: 0;
    height: 100vh;
    width: 100px; /* Szerokość marginesu bocznego z .container */
    z-index: -1;
    pointer-events: none;
    opacity: 0.4; /* Delikatna przezroczystość */
}

/* Lewy akcent (fioletowy) */
body::before {
    left: 0;
    background: 
        /* Pionowa linia z gradientem */
        linear-gradient(to bottom, rgba(168, 85, 247, 0) 0%, rgba(168, 85, 247, 0.5) 50%, rgba(168, 85, 247, 0) 100%);
    background-size: 2px 100%; /* Szerokość linii i pełna wysokość */
    background-position: 50% 50%; /* Wyśrodkowanie linii */
    background-repeat: no-repeat;
}

/* Prawy akcent (neonowy zielony) */
body::after {
    right: 0;
    background: 
        /* Pionowa linia z gradientem */
        linear-gradient(to bottom, rgba(57, 255, 20, 0) 0%, rgba(57, 255, 20, 0.4) 50%, rgba(57, 255, 20, 0) 100%);
    background-size: 2px 100%;
    background-position: 50% 50%;
    background-repeat: no-repeat;
}

/* Globalny pasek przewijania (Chrome, Edge, Safari, Opera) */
::-webkit-scrollbar {
    width: 12px; /* Główne paski mogą być odrobinę szersze */
    height: 12px;
}
::-webkit-scrollbar-track {
    background: #0b0b0d; /* Bardzo ciemne tło (prawie czarne) */
}
::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.6); /* Fiolet ThePresja */
    border-radius: 10px;
    border: 3px solid #0b0b0d; /* Odstęp od krawędzi dzięki ramce w kolorze tła */
}
::-webkit-scrollbar-thumb:hover {
    background: #39ff14 !important; /* Neonowa zieleń przy najechaniu */
}

/* Animowana poświata myszki */
#mouse-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.08) 0%, transparent 50%);
    border-radius: 50%;
    pointer-events: none; /* Pozwala klikać "przez" poświatę */
    z-index: 9999; /* Wyciągnięte na wierzch, aby tło strony go nie zasłaniało */
    margin-left: -150px; /* Wyśrodkowanie względem kursora */
    margin-top: -150px;
    transition: transform 0.05s ease-out; /* Płynne, lekko opóźnione podążanie za kursorem */
    will-change: transform; /* Optymalizacja wydajności */
}

@media (max-width: 768px) {
    #mouse-glow {
        display: none; /* Wyłączamy na telefonach (brak myszki) */
    }
}

/* .container {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 20px;
    height: 100vh;
    padding: 20px;
    box-sizing: border-box;
} */
.container {
    display: grid;
    /* Użycie minmax(0, 1fr) jest kluczowe, aby kolumna mogła się zwężać */
    grid-template-columns: 280px minmax(0, 1fr) 280px; 
    gap: 12px; /* Zmniejszona luka między kolumnami */
    padding: 12px; /* Zmniejszony padding kontenera */
    box-sizing: border-box;
    margin-top: 50px; /* Dopasowane do wysokości topbara */
    margin-left: 0;
    margin-right: 0;
    width: 100%;
}
.section { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
h2 { color: #2c3e50; border-bottom: 2px solid #eee; padding-bottom: 10px; }
.box {
  background: rgba(29, 29, 34, 0.85); /* Jaśniejsze, ciemnoszare tło */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(168, 85, 247, 0.2); /* Delikatna fioletowa ramka */
  border-top: 3px solid #a855f7; /* Fioletowy akcent na górze */
  padding: 12px 15px; /* Zmniejszony padding wewnątrz boxa */
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.5s ease;
  contain: layout;
  margin-bottom: 10px; /* Mniejszy odstęp pod boxem */
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.box:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.95);
  border-color: rgba(168, 85, 247, 0.4);
}

/* Styl dla nagłówków wewnątrz boksów */
.box h2 {
  color: #39ff14; /* Neonowe zielone nagłówki */
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.4); /* Efekt świecenia */
  border-bottom: 1px solid rgba(168, 85, 247, 0.3); /* Fioletowa linia podziału */
  font-size: 1.2em;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin: 0;
  padding-bottom: 8px;
  margin-bottom: 10px; /* Zmniejszony odstęp pod nagłówkiem wewnątrz boxa */
}

/* --- Rich Text Content (TinyMCE output) --- */
.npc-notes table, .quest-notes table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
}
.npc-notes td, .npc-notes th,
.quest-notes td, .quest-notes th {
    border: 1px solid #555;
    padding: 6px 10px;
    color: #f1f5f9;
}
.npc-notes th, .quest-notes th {
    background: rgba(168,85,247,0.2);
    color: #ffcc00;
}
.toc-list {
    background: rgba(168,85,247,0.08);
    border: 1px dashed rgba(168,85,247,0.5);
    padding: 12px 20px;
    border-radius: 8px;
    margin: 15px 0;
}
.toc-list ol {
    margin: 8px 0 0 0;
    padding-left: 20px;
}
.toc-list li {
    margin: 4px 0;
}
.toc-list a {
    color: #a855f7;
    text-decoration: none;
    font-weight: bold;
}
.toc-list a:hover {
    text-decoration: underline;
    color: #c084fc;
}
h2[id], h3[id], h4[id] {
    scroll-margin-top: 70px;
}

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

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Pozycjonowanie w prawym górnym rogu - z tłem boxa */
.top-right-auth {
    position: absolute;
    top: -120px; /* Przywrócona pierwotna pozycja */
    right: 20px; /* Wyrównanie do nowej krawędzi (zgodnie z paddingiem kontenera) */
    z-index: 1000;
    background: rgba(45, 45, 52, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-top: 3px solid #a855f7;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.9);
}

/* Styl przycisku Discord */
.btn-discord {
    display: flex;       /* Używamy flexboxa do wyrównania */
    align-items: center; /* Wyśrodkowanie w pionie */
    justify-content: center; /* Wyśrodkowanie w poziomie (jeśli przycisk jest szeroki) */
    gap: 10px;           /* Odstęp między ikoną a tekstem */
    background-color: #5865F2;
    color: white !important; /* Wymuszenie białego tekstu */
    text-decoration: none;
    padding: 6px 12px; /* Zmniejszono padding */
    font-size: 13px; /* Mniejsza czcionka */
    border-radius: 4px;
    font-weight: bold;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
}

.btn-discord:hover {
    background-color: #4752c4;
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.4);
    transform: translateY(-2px);
}

/* Styl dla samej ikony, aby dobrze wyglądała na różnych ekranach */
.btn-discord img {
    display: block;
    width: 16px; /* Zmniejszono ikonę */
    height: auto;
}

/* Widok zalogowanego użytkownika */
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px; /* Dopasowano do odstępu na przycisku Discord */
    margin-top: 0; /* Usunięto margines górny */
}

.avatar {
    width: 32px; /* Powiększono ciut, aby box był identyczny jak przycisk Discord */
    height: 32px;
    border-radius: 50%;
    border: 1px solid #0de618;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.username {
    font-weight: 600;
    font-size: 13px; /* Dopasowano do wielkości tekstu na przycisku logowania */
    color: #f8fafc;
}

.btn-logout {
    color: #ff4d4d;
    text-decoration: none;
    font-size: 0.8em;
    margin-top: 5px;
}

.btn-logout:hover {
    text-decoration: underline;
}
.relative-column {
    position: relative;
}
.user-panel-links {
    display: flex;
    flex-direction: column;
    gap: 2px; /* Zmniejszony odstęp między linkami panelu */
}

.stream-link-item {
    max-width: 180px; /* Ustal sztywną szerokość poświaty */
    display: block;
    padding: 2px 10px; /* Zmniejszony padding pionowy */
    color: #e2e8f0; /* Jaśniejsze napisy w menu */
    text-decoration: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    margin-bottom: 2px; /* Zmniejszony margines dolny */
}

/* EFEKT HOVER - Tylko na konkretny element */
.stream-link-item:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.5); /* Fioletowa ramka po najechaniu */
    color: #39ff14; /* Neonowy zielony tekst */
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.4);
    padding-left: 18px;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.2);
    transform: translateX(4px);
}

/* Mały wskaźnik przed tekstem pojawiający się przy hoverze */
.stream-link-item::before {
    content: '⚙';
    margin-right: 8px;
    color: #39ff14; /* Neonowa zielona ikona zębatki */
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stream-link-item:hover::before {
    opacity: 1;
}

/* Prosty przycisk bez efektu szkła */
.btn-simple {
    display: inline-block;
    padding: 6px 15px;
    font-size: 13px;
    background: rgba(15, 15, 18, 0.8);
    border: 1px solid rgba(168, 85, 247, 0.5);
    border-radius: 6px;
    color: #ddd;
    text-decoration: none;
    transition: all 0.2s ease;
}
.btn-simple:hover {
    border-color: #a855f7;
    color: #fff;
    background: rgba(168, 85, 247, 0.1);
}

/* Małe przyciski akcji (Edytuj / Usuń) w tabelach */
.btn-action-edit {
    font-size: 12px;
    padding: 4px 8px;
    border-color: #39ff14 !important;
    color: #39ff14 !important;
}
.btn-action-edit:hover {
    background: rgba(57, 255, 20, 0.1) !important;
    color: #fff !important;
}

.btn-action-delete {
    font-size: 12px;
    padding: 4px 8px;
    border-color: #ff4444 !important;
    color: #ff4444 !important;
    margin-left: 5px;
    cursor: pointer;
}
.btn-action-delete:hover {
    background: rgba(255, 68, 68, 0.1) !important;
    color: #fff !important;
}

/* Duże przyciski narzędziowe (góra strony: Włącz edycję, Dodaj) */
.btn-tool-green {
    border-color: #39ff14 !important;
    color: #39ff14 !important;
}
.btn-tool-green:hover {
    background: rgba(57, 255, 20, 0.1) !important;
    color: #fff !important;
}

.btn-tool-red {
    border-color: #ff4444 !important;
    color: #ff4444 !important;
}
.btn-tool-red:hover {
    background: rgba(255, 68, 68, 0.1) !important;
    color: #fff !important;
}

.btn-tool-purple {
    border-color: #a855f7 !important;
    color: #a855f7 !important;
}
.btn-tool-purple:hover {
    background: rgba(168, 85, 247, 0.1) !important;
    color: #fff !important;
}

.skill-btn {
    /* Styl skopiowany z .skill-btn-forge dla spójności */
    padding: 12px;
    background: rgba(15, 15, 18, 0.8);
    border: 1px solid rgba(168, 85, 247, 0.5);
    border-radius: 8px;
    color: #39ff14;
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.4);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.skill-btn:hover {
    background: #39ff14;
    color: #000;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.6);
    transform: translateY(-2px); /* Lekkie uniesienie */
}

.skill-btn:active {
    transform: translateY(0); /* Efekt wciśnięcia */
}


.skill-btn:hover::before {
    left: 100%;
}

/* --- EQUIPMENT GRID --- */
.eq-grid {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}

.eq-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.eq-left {
    justify-content: flex-start;
    align-items: flex-end;
}

.eq-center {
    justify-content: flex-start;
}

.eq-right {
    justify-content: flex-start;
    align-items: flex-start;
}

.eq-slot-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.item-tier-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff8c00; /* Pomarańczowy */
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 4px;
    border: 1px solid #cc7000;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.8);
    pointer-events: none;
}

/* --- Vocation Tabs --- */
.voc-tabs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    margin-bottom: 15px;
    align-items: center;
    justify-content: center;
}

.voc-tab {
    padding: 6px 12px;
    background: rgba(15, 15, 18, 0.8);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 6px;
    color: #cbd5e1;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.voc-tab.active {
    background: rgba(168, 85, 247, 0.2);
    border-color: #39ff14;
    color: #39ff14;
    text-shadow: 0 0 5px rgba(57, 255, 20, 0.4);
}

.voc-tab:hover:not(.active) {
    border-color: #a855f7;
    color: #fff;
}

.voc-tab-add {
    padding: 6px 12px;
    background: rgba(57, 255, 20, 0.1);
    border: 1px dashed #39ff14;
    color: #39ff14;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.voc-tab-add:hover {
    background: rgba(57, 255, 20, 0.2);
    transform: scale(1.05);
}

.btn-tab-action {
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    transition: 0.2s;
}

.btn-tab-action:hover {
    transform: scale(1.1);
    text-shadow: 0 0 5px rgba(255, 68, 68, 0.5);
}

.btn-tab-action.edit-name {
    color: #3b82f6;
}

.btn-tab-action.edit-name:hover {
    text-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
}

.eq-slot {
    width: 34px;
    height: 34px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.eq-slot:hover {
    border-color: #39ff14;
    box-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
}

.eq-slot img {
    max-width: 32px;
    max-height: 32px;
    image-rendering: pixelated;
}

.player-eq-box {
    animation: fadeIn 0.4s ease;
}

/* --- Monster Detail Styles --- */
.monster-section-title {
    color: #a855f7; font-size: 1.2em; text-align: center; margin: 30px 0 15px 0; padding-bottom: 5px;
    border-bottom: 1px dashed rgba(168, 85, 247, 0.3); text-transform: uppercase; letter-spacing: 1px; text-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}
.monster-image-box { display: inline-block; padding: 15px; background: url('/images/trawa.png') repeat; border: 1px solid rgba(168, 85, 247, 0.5); border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.5); }

.loot-container { border: 1px solid rgba(168, 85, 247, 0.2); background: rgba(0,0,0,0.3); padding: 20px; margin-top: 15px; border-radius: 12px; }

.item-legendary { border: 2px solid #ffd700; box-shadow: inset 0 0 10px rgba(255, 215, 0, 0.2), 0 0 8px rgba(255, 215, 0, 0.2); animation: legendaryGlow 2s infinite alternate; }
.item-epic      { border: 2px solid #a855f7; box-shadow: inset 0 0 10px rgba(168, 85, 247, 0.2), 0 0 8px rgba(168, 85, 247, 0.2); }
.item-rare      { border: 2px solid #3b82f6; box-shadow: inset 0 0 10px rgba(59, 130, 246, 0.2), 0 0 8px rgba(59, 130, 246, 0.2); }
.item-uncommon  { border: 2px solid #10b981; box-shadow: inset 0 0 10px rgba(16, 185, 129, 0.2), 0 0 8px rgba(16, 185, 129, 0.2); }
.item-common    { border: 2px solid #6b7280; box-shadow: inset 0 0 10px rgba(107, 114, 128, 0.2); }
.item-trash     { border: 2px solid #4b5563; }

@keyframes legendaryGlow { 0% { box-shadow: inset 0 0 5px rgba(255, 215, 0, 0.2); } 100% { box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.5), 0 0 10px rgba(255, 215, 0, 0.3); } }

.loot-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 20px 15px; justify-items: center; }
.item-wrapper-detail { display: flex; flex-direction: column; align-items: center; width: 100%; }
.loot-card { width: 54px; height: 54px; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; padding: 4px; border-radius: 8px; transition: all 0.3s ease; position: relative; }

.loot-card.item-legendary:hover { transform: scale(1.15); border-color: #fff; box-shadow: inset 0 0 15px rgba(255, 215, 0, 0.4), 0 0 15px rgba(255, 215, 0, 0.6); }
.loot-card.item-epic:hover      { transform: scale(1.15); border-color: #e9d5ff; box-shadow: inset 0 0 15px rgba(168, 85, 247, 0.4), 0 0 15px rgba(168, 85, 247, 0.6); }
.loot-card.item-rare:hover      { transform: scale(1.15); border-color: #bfdbfe; box-shadow: inset 0 0 15px rgba(59, 130, 246, 0.4), 0 0 15px rgba(59, 130, 246, 0.6); }
.loot-card.item-uncommon:hover  { transform: scale(1.15); border-color: #a7f3d0; box-shadow: inset 0 0 15px rgba(16, 185, 129, 0.4), 0 0 15px rgba(16, 185, 129, 0.6); }
.loot-card.item-common:hover    { transform: scale(1.15); border-color: #f3f4f6; box-shadow: inset 0 0 15px rgba(107, 114, 128, 0.4), 0 0 15px rgba(107, 114, 128, 0.6); }

.loot-card img { image-rendering: pixelated; max-width: 46px; max-height: 46px; }
.item-name-label { font-size: 12px; color: #cbd5e1; text-align: center; margin-top: 8px; line-height: 1.2; font-weight: 500; word-wrap: break-word; width: 100%; }

.rarity-name { font-size: 10px; text-transform: uppercase; font-weight: bold; margin-top: 4px; letter-spacing: 0.5px; }
.text-legendary { color: #ffd700; text-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }
.text-epic      { color: #a855f7; text-shadow: 0 0 5px rgba(168, 85, 247, 0.5); }
.text-rare      { color: #3b82f6; text-shadow: 0 0 5px rgba(59, 130, 246, 0.5); }
.text-uncommon  { color: #10b981; text-shadow: 0 0 5px rgba(16, 185, 129, 0.5); }
.text-common    { color: #9ca3af; }
.text-trash     { color: #6b7280; }

.res-val { font-weight: bold; }
.res-positive { color: #39ff14; text-shadow: 0 0 5px rgba(57,255,20,0.3); }
.res-negative { color: #ff4444; text-shadow: 0 0 5px rgba(255,68,68,0.3); }
.res-neutral { color: #94a3b8; }

/* --- Biblioteka (Questy, Potwory) - Nagłówki i Filtry --- */
.library-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    gap: 15px;
}
.library-header-left {
    flex: 1;
    min-width: 10px;
}
.library-header-center {
    text-align: center;
    flex: auto;
}
.library-header-center h1 {
    margin: 0 auto !important;
}
.library-header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    min-width: max-content;
}
.btn-edit-action {
    text-decoration: none;
    padding: 6px 12px;
    font-size: 13px;
}
.btn-edit-danger {
    border-color: #ff4444;
    color: #ff4444;
}
.library-filter-form {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.library-filter-select {
    font-weight: bold;
    background: rgba(15, 15, 18, 0.9);
    color: #f1f5f9;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid rgba(168, 85, 247, 0.5);
    text-align: center;
}

/* --- Multi-Select Dropdown --- */
.multi-select {
    position: relative;
    display: inline-block;
    min-width: 140px;
}
.multi-select-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    font-weight: bold;
    background: rgba(15, 15, 18, 0.9);
    color: #f1f5f9;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid rgba(168, 85, 247, 0.5);
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    user-select: none;
    transition: border-color 0.2s;
}
.multi-select-btn:hover,
.multi-select.open .multi-select-btn {
    border-color: #a855f7;
}
.multi-select-btn .ms-arrow {
    font-size: 10px;
    transition: transform 0.2s;
    color: #a855f7;
}
.multi-select.open .ms-arrow {
    transform: rotate(180deg);
}
.multi-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    max-height: 240px;
    overflow-y: auto;
    background: rgba(15, 15, 18, 0.97);
    border: 1px solid rgba(168, 85, 247, 0.6);
    border-radius: 6px;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    padding: 4px 0;
}
.multi-select.open .multi-select-dropdown {
    display: block;
}
.multi-select-dropdown label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    color: #cbd5e1;
    font-size: 13px;
    transition: background 0.15s;
    white-space: nowrap;
}
.multi-select-dropdown label:hover {
    background: rgba(168, 85, 247, 0.15);
}
/* --- Toggle Switch (Party Hunt privacy) --- */
.ph-toggle {
    position: relative;
    display: inline-block;
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    height: 16px !important;
    flex-shrink: 0;
    cursor: pointer;
}
.ph-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.ph-toggle .ph-toggle-track {
    position: absolute;
    inset: 0;
    background: #555;
    border-radius: 16px;
    transition: background 0.3s;
}
.ph-toggle input:checked + .ph-toggle-track {
    background: #39ff14;
}
.ph-toggle .ph-toggle-dot {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}
.ph-toggle input:checked ~ .ph-toggle-dot {
    transform: translateX(14px);
}

.multi-select-dropdown input[type="checkbox"] {
    accent-color: #a855f7;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}
.multi-select-dropdown input[type="checkbox"]:checked + span {
    color: #fff;
    font-weight: bold;
}
.ms-badge {
    background: #a855f7;
    color: #fff;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: bold;
    margin-left: 2px;
}

/* --- Charms Styles --- */
.charms-grid-container {
    display: grid;
    /* Automatycznie zmieści tyle kolumn ile zdoła (minimum 320px szerokości, na dużych ekranach będą 3-4, na telefonach 1) */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.charm-card {
    background: rgba(15, 15, 18, 0.85);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s, border-color 0.3s;
}
.charm-card:hover {
    transform: translateY(-2px);
    border-color: #39ff14;
}
.charm-card-header {
    display: flex;
    gap: 15px;
    align-items: center;
}
.charm-card-image {
    flex-shrink: 0;
    text-align: center;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 5px;
    border: 1px solid rgba(255,255,255,0.05);
}
.charm-card-title-area {
    flex-grow: 1;
}
.charm-stat-badge {
    background: rgba(0,0,0,0.3); 
    padding: 4px 8px; 
    border-radius: 4px; 
    border: 1px solid transparent;
    white-space: nowrap;
    display: inline-block;
    margin-bottom: 4px;
}
.charm-card-levels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: auto; /* Wypycha statystyki na sam dół (równa wysokość kart) */
}
.charm-level-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 4px;
    text-align: center;
}
.header-with-icon {
    display: flex;
    align-items: center; /* Wyśrodkowanie pionowe gifa i tekstu */
    gap: 10px;           /* Odstęp między gifem a napisem */
}

.box-icon {
    width: 32px;         /* Dopasuj rozmiar do wysokości czcionki h2 */
    height: 32px;
    object-fit: contain;
}
/* Style dla stron tekstowych (Regulamin itp.) */
.legal-page {
    padding: 10px;
    line-height: 1.6;
}
h1 {
  /* 1. Układ: To naprawia gify lewo/prawo */
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 15px !important;

  /* 2. Centrowanie: To naprawia uciekanie do lewej */
  margin-left: auto !important;
  margin-right: auto !important;
  display: flex !important; /* Zmiana na flex przy szerokości fit-content ułatwia centrowanie marginesem */
  width: fit-content;

  /* 3. Twoje style wizualne */
  padding: 6px 20px;
      background: linear-gradient(145deg, rgba(15, 15, 18, 0.95), rgba(10, 10, 12, 0.95));
  backdrop-filter: blur(8px);
      border: 1px solid rgba(168, 85, 247, 0.5); /* Fioletowa ramka */
  border-radius: 12px;
  font-size: 24px;
  font-weight: 800;
      color: #39ff14; /* Neonowy zielony tekst */
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.5); /* Neonowe świecenie */
  letter-spacing: 1px;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

h1 img {
    max-width: 72px; /* Powiększone z 48px, aby nagłówkowe gify NPC miały więcej miejsca */
    height: auto;
    object-fit: contain;
    image-rendering: pixelated; /* Dodane zapobieganie rozmyciu przy sztucznym powiększeniu */
}
.h1-colored {
    color: #ffcc00;
    font-size: 24px;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px #000;
}

.h2-colored {
    color: #54491d;
    font-size: 19px;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(84, 73, 29, 0.3);
    padding-bottom: 3px;
}

.legal-page ul {
    margin-bottom: 15px;
    padding-left: 25px;
}

.legal-page li {
    margin-bottom: 5px;
    color: #4a3b2a; /* Ciemny brąz pasujący do stylu Tibii */
}

.legal-page p {
    margin-bottom: 10px;
}
.box-auto-height {
    align-self: flex-start; /* To blokuje rozciąganie w pionie wewnątrz flexa */
    width: 100%;            /* Zachowuje pełną szerokość kolumny */
    margin-bottom: 10px;    /* Odstęp od dolnego boxa (#mid) */
    height: auto;           /* Wysokość dopasowana do zawartości */
}

.column {
    position: relative; /* Potrzebne, aby logo trzymało się szerokości kolumny */
}

/* Styl dla boxa, który ma być "krótki" */
.box-header-only {
    width: 100%;             /* Chcemy, żeby był szeroki na całą kolumnę */
    height: auto;            /* Wysokość automatyczna do zawartości */
    flex-grow: 0;            /* Zakazujemy mu "puchnięcia" */
    display: block;          /* Standardowy układ blokowy */
    padding: 10px 15px;      /* Możesz nieco zmniejszyć padding dla tego mniejszego boxa */
}

.box-header-only h2 {
    margin: 0;               /* Usuwamy marginesy nagłówka, żeby nie powiększały boxa */
    font-size: 1.2rem;
}

/* Box dolny (mid) */
#mid {
    width: 100%;
    /* flex-grow: 1; */
    overflow-x: auto; 
    overflow-y: visible;
    box-sizing: border-box;
    /* max-height: 100vh; */
}
#mid table {
    max-width: 100%;
    display: table;
    border-collapse: collapse;
    /* Gwarantuje wyśrodkowanie tabeli od pierwszej milisekundy ładowania strony */
    margin-left: auto;
    margin-right: auto;
}

#mid img:not(.event-select img):not(.outfit-select img):not(.skill-select img):not(.forge-gif-icon) {
    max-width: 100%;
    height: auto;
}

/* --- BAZOWY SZKIELET KUŹNI (Zapobiega mignięciu podczas ładowania AJAX) --- */
.forge-overlay {
    margin: 0 auto;
    max-width: 500px;
    width: 100%;
}
.forge-gif-icon {
    width: 32px !important;
    height: 32px !important;
}

.middle-column {
    position: relative; /* Potrzebne, aby szybkie linki trzymały się środkowej kolumny */
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    margin-top: 0;
    /*overflow-x: auto; /* Pozwala przewijać szerokie moduły jak Proficiency na mniejszych ekranach */
    overflow: visible; /* Zmiana: pozwala panelom wychodzić poza kontener (np. Boosted na top: -115px) */
}


.middle-column .box {
    width: 100%;
    box-sizing: border-box; /* Padding nie zwiększa szerokości */
    overflow: visible !important; /* Zapobiega ucinaniu list rozwijanych (np. wyszukiwarka w TinyMCE) */
    word-wrap: break-word;  /* Rozbija długie wyrazy, jeśli by się pojawiły */
}

/* 3. Specyficzna poprawka dla boxa nagłówkowego */
.box-header-only {
    flex-shrink: 0; 
}

/* 4. Zapewnienie, że h2 w środku nie wypycha kontenera */
.middle-column h2 {
    max-width: 100%;
    white-space: nowrap;    /* Zapobiega zawijaniu, ale... */
    overflow: hidden;       /* ...jeśli tekst jest za długi, zostanie ucięty... */
    text-overflow: ellipsis; /* ...i dodane zostaną kropki (...) */
}

.event-select, .outfit-select, .skill-select {
    display: flex !important;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.event-select label, .outfit-select label, .skill-select label {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-align: center;
}

/* Naprawa obrazków wewnątrz tych kontenerów */
.event-select img, .outfit-select img, .skill-select img {
    display: inline-block; /* Przywraca obrazki obok siebie */
    width: 32px;           /* Stała szerokość dla ikon skilli/eventów */
    height: 32px;
    margin-bottom: 5px;
}

/* Specyficzna poprawka dla outfitów, które mogą być większe */
.outfit-select img {
    width: 64px;
    height: 64px;
}

/* Kontener nawigacji - dodajemy wyśrodkowanie */
.tabs-nav {
    display: flex;
    justify-content: center; /* To wyśrodkowuje zakładki w poziomie */
    gap: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 15px;
    width: 100%;
}

/* Pojedyncza zakładka */
.tab-item {
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px 8px 0 0;
    border: 1px solid transparent;
    position: relative;
    top: 2px;
    background: transparent;
}

.tab-text {
    color: #cbd5e1;
    font-weight: 600;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

/* Zakładka aktywna */
.tab-item.active {
    background: rgba(168, 85, 247, 0.15); /* Fioletowe tło */
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-bottom: 2px solid #a855f7; /* Fioletowy pasek */
}

.tab-item.active .tab-text {
    color: #39ff14; /* Neonowy zielony tekst na fioletowej zakładce */
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.4);
}

/* Efekt hover */
.tab-item:hover:not(.active) .tab-text {
    color: #39ff14; /* Neonowy zielony hover na nieaktywnych zakładkach */
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.3);
    transform: translateY(-1px);
    display: inline-block;
}

/* Logika wyświetlania treści */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease; /* Używamy Twojej animacji fadeIn! */
}

.tab-content.active {
    display: block;
}
.tab-item {
    outline: 0 !important;
    outline: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    text-decoration: none !important;
    border-bottom: none !important;
}

/* Usuwamy wszelkie efekty cienia/tła w momencie samego naciśnięcia */
.tab-item:active, .tab-item:focus {
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

/* --- LOGO --- */
.main-logo-container {
    position: absolute;
    top: -125px; /* Przytulone do samej góry, by zrobić maksymalnie dużo miejsca */
    left: 0;
    width: 70%;
    z-index: 100;
    box-sizing: border-box;
    text-align: center;
}
.main-logo-container img {
    max-width: 100%;
    max-height: 196px; /* Kompresja rozmiaru, by zyskać miejsce w pionie */
    object-fit: contain;
    height: auto;
    filter: drop-shadow(0 0 15px rgba(168, 85, 247, 0.4)); /* Fioletowy blask dla logo */
    transition: transform 0.3s ease, filter 0.3s ease;
}
.main-logo-container img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 20px rgba(57, 255, 20, 0.6)); /* Zielony blask przy najeździe */
}

/* --- BOOSTED (BEZ BOXA) --- */
.boosted-header-container {
    position: absolute;
    top: -115px; /* Idealnie pośrodku między logiem a linkami */
    left: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: flex-start;
    gap: 25px; /* Zmniejszony odstęp, by pomieścić 4 elementy */
    align-items: center;
    pointer-events: none; /* Żeby nie blokowało kliknięć w tło */
}

.boosted-header-item {
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto; /* Przywracamy klikalność dla poszczególnych wpisów */
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.boosted-header-item:hover {
    transform: translateY(-3px) scale(1.05); /* Subtelne unoszenie się */
}

.boosted-header-item img {
    max-width: 66px; /* Zmniejszone dla dopasowania w bezpiecznej sekcji */
    max-height: 66px;
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.6)); /* Fioletowy glow wokół gifa */
}

.boosted-header-text {
    display: flex;
    flex-direction: column;
    font-size: 11px;
    color: #94a3b8; /* Bardziej stonowany kolor "podtytułu" */
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
    text-align: left;
}

.boosted-header-text strong {
    font-size: 14px;
    color: #39ff14; /* Neonowy zielony tekst z motywu ThePresja */
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.4);
    letter-spacing: 0.5px;
}

/* --- SZYBKIE LINKI --- */
/* Usuwamy stare style, zostawiamy tylko bazową klasę jeśli jest używana gdzie indziej */
.quick-links-container { display: none; }

/* --- NOWY WIDGET STREAMERÓW (LEFT BOTTOM) --- */
.streamers-bubble-container {
    position: fixed;
    bottom: 25px;
    left: 25px;
    z-index: 9998;
}

.streamers-trigger {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(168, 85, 247, 0.85);
    border: 2px solid #a855f7;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.streamers-trigger:hover, .streamers-trigger.active {
    transform: scale(1.1);
    background: #a855f7;
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.8);
    border-color: #39ff14;
}

.streamer-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #39ff14;
    color: #000;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    border: 1px solid #000;
}

.streamers-popup {
    display: none;
    position: absolute;
    bottom: 70px;
    left: 0;
    width: 250px;
    background: rgba(15, 15, 18, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(168, 85, 247, 0.5);
    border-radius: 16px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.9);
    overflow: hidden;
    flex-direction: column;
}

.streamers-popup.active {
    display: flex;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) reverse; /* Animacja w górę */
}

.streamers-popup-header {
    padding: 12px 15px;
    background: rgba(168, 85, 247, 0.1);
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: #39ff14;
    font-size: 13px;
    text-transform: uppercase;
}

.close-streamers {
    background: none;
    border: none;
    color: #ff4444;
    font-size: 20px;
    cursor: pointer;
}

.streamers-popup-list {
    padding: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.streamer-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.streamer-row:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.3);
    padding-left: 15px;
}

.streamer-row img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #39ff14;
}

.streamer-name {
    color: #f1f5f9;
    font-size: 14px;
    font-weight: 500;
}

.add-streamer-inline {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background: rgba(57, 255, 20, 0.05);
    border: 1px dashed rgba(57, 255, 20, 0.3);
    border-radius: 8px;
    color: #39ff14;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-weight: bold;
}

.add-streamer-inline:hover {
    background: rgba(57, 255, 20, 0.15);
    border-color: #39ff14;
}

/* --- PRAWY PANEL SZYBKICH LINKÓW (PIONOWY) --- */
.right-sidebar-links {
    display: none;
}

/* Nowe style dla menu rozwijanego w profilu */
.user-menu-container {
    position: relative;
    margin-left: 5px;
}

.user-menu-toggle {
    background: none;
    border: none;
    color: #39ff14;
    font-size: 14px;
    cursor: pointer;
    padding: 2px;
    transition: transform 0.3s ease, text-shadow 0.3s ease;
    display: flex;
    align-items: center;
}

.user-menu-toggle:hover {
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.8);
}

.user-menu-toggle.active {
    transform: rotate(180deg);
    text-shadow: 0 0 15px rgba(57, 255, 20, 1), 0 0 5px rgba(57, 255, 20, 0.8);
}

.user-dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: -20px;
    background: rgba(15, 15, 18, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(168, 85, 247, 0.5);
    border-radius: 12px;
    min-width: 220px;
    padding: 10px;
    z-index: 1100;
    box-shadow: 0 15px 40px rgba(0,0,0,0.9);
    flex-direction: column;
    gap: 2px; /* Zmniejszony odstęp wewnątrz dropdowna */
}

.user-dropdown-content.show {
    display: flex;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}


.right-sidebar-links .quick-link img {
    filter: none; /* Zawsze pełny kolor (brak efektu ożywiania) */
    opacity: 1;
    border-radius: 8px; /* Dopasowane do kwadratowej ramki */
    max-width: 28px; /* Zmniejszenie obrazka */
    max-height: 28px;
}

.right-sidebar-links .quick-link:hover {
    transform: scale(1.15); /* Tylko płynne powiększenie bez podskakiwania */
    border-color: #39ff14; /* Zielony akcent przy najechaniu */
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.4);
    background: rgba(57, 255, 20, 0.1);
}

/* Przystosowanie linków do menu rozwijanego */
.user-dropdown-content .stream-link-item {
    max-width: none;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0;
    background: rgba(168, 85, 247, 0.05);
}

.user-dropdown-content .stream-link-item:hover {
    background: rgba(168, 85, 247, 0.15);
    padding-left: 20px;
    transform: translateX(0); /* Wyłączamy przesuwanie w bok wewnątrz dropdowna */
}


/* Tooltipy dla szybkich linków - pojawiające się z prawej strony przycisku */
.quick-link[data-tooltip]::after {
    bottom: 50%;
    left: 100%;
    right: auto;
    transform: translateY(50%);
    margin-left: 15px;
    width: max-content;
    white-space: nowrap;
}

/* Tooltipy dla prawych linków muszą wyskakiwać w lewo */
.right-sidebar-links .quick-link[data-tooltip]::after {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: 15px;
    width: max-content;
    white-space: nowrap;
}

/* --- Monsters Page Styles --- */

.page-header-box {
    border: 2px;
    margin-bottom: 10px;
    margin-top: 10px;
}

.page-header-title {
    letter-spacing: 2px;
    font-size: 15px;
    text-align: center;
    margin-top: 10px;
}

.page-header-text {
    display: inline-block;
    padding: 6px 20px;
    background: rgba(0,0,0,0.95);
    border: 2px solid #3a2d1a;
    border-radius: 6px;
    font-size: 20px;
    font-weight: 800;
    color: #ffd37a;
    letter-spacing: 1px;
}

/* Result Table */
.result-table td {
    padding: 8px 10px;
    border-top: 2px solid rgba(168, 85, 247, 0.3);
    border-left: 2px solid rgba(168, 85, 247, 0.3);
    border-bottom: 2px solid rgba(168, 85, 247, 0.3);
    border-right: 2px solid rgba(168, 85, 247, 0.3);
    color: #ddd;
    font-size: 14px;
    background: rgba(37, 36, 36, 0.25);
    text-align: center;
}


.result-table tr:hover td {
    background: rgba(168, 85, 247, 0.1);
}

.weapon-icon {
    vertical-align: middle;
    margin-right: 6px;
}

/* Search & Pagination Helpers */
.monster-search-form {
    text-align: center; 
    margin-bottom: 15px;
}

.monster-search-input {
    font-weight: bold;
    background: rgba(15, 15, 18, 0.9);
    color: #f1f5f9;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid rgba(168, 85, 247, 0.5);
    text-align: center;
    width: 250px;
}

/* Custom scrollbar dla wyników Live Search */
#live-search-results::-webkit-scrollbar {
    width: 6px;
}
#live-search-results::-webkit-scrollbar-track {
    background: rgba(15, 15, 18, 0.8);
    border-bottom-right-radius: 12px;
}
#live-search-results::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.5); /* Fiolet ThePresja */
    border-radius: 10px;
}
#live-search-results::-webkit-scrollbar-thumb:hover {
    background: #39ff14 !important; /* Neonowa zieleń ThePresja */
}

.no-results {
    text-align: center;
    color: #4a3b2a;
    font-weight: bold;
}

.monster-link {
    font-weight: bold;
    color: #39ff14; /* Neonowy zielony */
    text-decoration: none;
    transition: all 0.3s ease;
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.4);
}

.monster-link:hover {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.8), 0 0 20px rgba(57, 255, 20, 0.4);
    letter-spacing: 0.5px; /* Delikatne rozciągnięcie przy najechaniu */
}

.pagination-info {
    font-weight: bold; 
    color: #4a3b2a;
    margin: 0 5px;
}
.pagination-container {
    text-align: center;
    margin: auto;
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
}
.boxes-wrapper {
    display: flex;       /* Włącza tryb obok siebie */
    gap: 10px;          /* Zmniejszony odstęp między boksami obok siebie */
    width: 100%;        /* Cała szerokość strony */
    align-items: flex-start; /* Zapobiega rozciąganiu boksów w pionie */
}

.boxes-wrapper .box {
    flex: 1;            /* Sprawia, że oba boksy mają taką samą szerokość */
    max-width: 100%;     /* Pilnuje, żeby nie wyszły poza połowę */
    margin-bottom: 10px;
}

/* Opcjonalnie: na telefonach ustaw z powrotem jeden pod drugim */
@media (max-width: 768px) {
    .boxes-wrapper {
        flex-direction: column;
    }
    .boxes-wrapper .box {
        max-width: 100%;
    }
}

/* --- ADMIN FORMS GLOBAL STYLES --- */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}
.input-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.input-row label {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #cbd5e1;
    font-weight: 500;
    font-size: 0.95em;
}
.admin-input, .admin-textarea {
    width: 100%;
    background: rgba(15, 15, 18, 0.9);
    color: #f1f5f9;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid rgba(168, 85, 247, 0.5);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}
.admin-input:focus, .admin-textarea:focus {
    outline: none;
    border-color: #39ff14;
    box-shadow: 0 0 8px rgba(57, 255, 20, 0.3);
}
.admin-textarea {
    resize: vertical;
    min-height: 100px;
}
.admin-form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}
.admin-btn {
    padding: 12px 20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    min-width: 150px;
}
.admin-btn-save {
    background: rgba(15, 15, 18, 0.8);
    border-color: rgba(168, 85, 247, 0.5);
    color: #39ff14;
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.4);
}
.admin-btn-save:hover {
    background: #39ff14;
    color: #000;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.6);
    transform: translateY(-2px);
}
.admin-btn-cancel {
    background: rgba(15, 15, 18, 0.8);
    border-color: rgba(136, 136, 136, 0.5);
    color: #aaa;
    text-shadow: 0 0 8px rgba(136, 136, 136, 0.4);
}
.admin-btn-cancel:hover {
    background: #888;
    color: #fff;
    border-color: #fff;
    box-shadow: 0 0 15px rgba(136, 136, 136, 0.6);
    transform: translateY(-2px);
}
.admin-btn-delete {
    background: rgba(15, 15, 18, 0.8);
    border-color: rgba(220, 53, 69, 0.5);
    color: #ff4d4d;
    text-shadow: 0 0 8px rgba(220, 53, 69, 0.4);
}
.admin-btn-delete:hover {
    background: #dc3545;
    color: #fff;
    border-color: #ff4d4d;
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.6);
    transform: translateY(-2px);
}

/* Domyślnie ukryte elementy mobilne na komputerach */
.mobile-burger-btn, .mobile-close-btn, .mobile-only-tab {
    display: none !important;
}

/* --- RESPONSIVE: MAŁE MONITORY (1024-1366px) --- */
@media (max-width: 1366px) and (min-width: 901px) {
    .container {
        grid-template-columns: 200px minmax(0, 1fr) 200px;
        gap: 8px;
        padding: 8px;
    }
    .container > div:nth-of-type(1),
    .container > div:nth-of-type(3) {
        font-size: 11px;
    }
    .container > div:nth-of-type(1) .box,
    .container > div:nth-of-type(3) .box {
        padding: 8px 10px;
    }
    .container > div:nth-of-type(1) .box h2,
    .container > div:nth-of-type(3) .box h2 {
        font-size: 0.95em;
    }
    .container > div:nth-of-type(1) .box p,
    .container > div:nth-of-type(3) .box p,
    .container > div:nth-of-type(1) .box a,
    .container > div:nth-of-type(3) .box a,
    .container > div:nth-of-type(1) .box span,
    .container > div:nth-of-type(3) .box span,
    .container > div:nth-of-type(1) .box label,
    .container > div:nth-of-type(3) .box label {
        font-size: 11px;
    }
    .container > div:nth-of-type(1) .box .skill-btn,
    .container > div:nth-of-type(3) .box .skill-btn {
        font-size: 10px;
        padding: 6px 12px;
    }
    .container > div:nth-of-type(1) .box .header-with-icon .box-icon,
    .container > div:nth-of-type(3) .box .header-with-icon .box-icon {
        max-width: 18px;
        max-height: 18px;
    }
    .right-sidebar-links .quick-link {
        width: 34px;
        height: 34px;
    }
    .right-sidebar-links .quick-link img {
        max-width: 20px;
        max-height: 20px;
    }
}

@media (max-width: 1150px) and (min-width: 901px) {
    .container {
        grid-template-columns: 160px minmax(0, 1fr) 160px;
        gap: 6px;
        padding: 6px;
    }
    .container > div:nth-of-type(1),
    .container > div:nth-of-type(3) {
        font-size: 10px;
    }
    .container > div:nth-of-type(1) .box,
    .container > div:nth-of-type(3) .box {
        padding: 6px 8px;
    }
    .container > div:nth-of-type(1) .box h2,
    .container > div:nth-of-type(3) .box h2 {
        font-size: 0.85em;
    }
    .container > div:nth-of-type(1) .box p,
    .container > div:nth-of-type(3) .box p,
    .container > div:nth-of-type(1) .box a,
    .container > div:nth-of-type(3) .box a,
    .container > div:nth-of-type(1) .box span,
    .container > div:nth-of-type(3) .box span,
    .container > div:nth-of-type(1) .box label,
    .container > div:nth-of-type(3) .box label {
        font-size: 10px;
    }
    .container > div:nth-of-type(1) .box .skill-btn,
    .container > div:nth-of-type(3) .box .skill-btn {
        font-size: 9px;
        padding: 5px 10px;
    }
    .container > div:nth-of-type(1) .box .header-with-icon .box-icon,
    .container > div:nth-of-type(3) .box .header-with-icon .box-icon {
        max-width: 16px;
        max-height: 16px;
    }
}

/* --- RESPONSIVE MOBILE LAYOUT (TELEFONY I MAŁE TABLETY) --- */
@media (max-width: 900px) {
    
    /* Wyłączenie bocznych linii (świateł), żeby nie psuły czytelności */
    body::before, body::after {
        display: none !important;
    }

    .hide-on-mobile {
        display: none !important;
    }

    /* 1. GŁÓWNY KONTENER - Przejście na tryb jednej kolumny */
    .container {
        display: flex !important;
        flex-direction: column !important;
        margin-top: 60px !important; /* Dopasowane do wysokości mobilnego topbara */
        margin-left: 0 !important;
        width: 100% !important;
        padding: 0px 10px 20px 10px !important; /* Usunięto górny padding dla zyskania miejsca */
    }

    /* 2. LEWY BOX (BURGER MENU) - Menu chowane poza ekranem */
    .container > div:nth-of-type(1) {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important; /* Domyślnie schowane */
        width: 280px !important;
        max-width: 85vw !important;
        height: 100% !important;
        background: rgba(15, 15, 18, 0.98) !important;
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        z-index: 2000 !important;
        transition: left 0.3s ease-in-out !important;
        overflow-y: auto !important;
        border-right: 1px solid rgba(168, 85, 247, 0.5) !important;
        padding: 70px 20px 120px 20px !important; /* Duży padding na dole pozwalający na swobodne przeskrolowanie burger menu */
        box-sizing: border-box !important; /* KLUCZOWE: wymusza wliczenie paddingu w wysokość 100% */
        box-shadow: 5px 0 25px rgba(0,0,0,0.8) !important;
        margin: 0 !important;
    }

    /* Przycisk X zamykający lewe menu */
    .mobile-close-btn {
        display: block !important;
        position: absolute !important;
        top: 20px !important;
        right: 20px !important;
        background: none !important;
        border: none !important;
        color: #ff4444 !important;
        font-size: 32px !important;
        cursor: pointer !important;
        z-index: 2005 !important;
    }

    /* Klasa otwierająca menu (wymaga przełączenia w JS) */
    .container > div:nth-of-type(1).open {
        left: 0 !important;
    }

    /* Klasa przycisku Burgera - Przycisk, który musisz dodać do pliku .ejs */
    .mobile-burger-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: fixed !important;
        top: 5px !important; /* Podniesione, by pasowało do wyższego logo */
        left: 15px !important;
        width: 42px !important;
        height: 42px !important;
        background: rgba(29, 29, 34, 0.95) !important;
        border: 2px solid rgba(168, 85, 247, 0.5) !important;
        border-radius: 8px !important;
        color: #39ff14 !important;
        z-index: 2001 !important;
        cursor: pointer !important;
        font-size: 24px !important;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5) !important;
    }

    /* 3. ŚRODKOWA KOLUMNA - Główna zawartość */
    .container > div:nth-of-type(2) {
        margin-top: 0 !important;
        width: 100% !important;
    }

    /* 4. PRAWE BOXY - Aplikacyjne zakładki na dole ekranu */
    .container > div:nth-of-type(3) {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 65px !important;
        background: rgba(15, 15, 18, 0.98) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        border-top: 1px solid rgba(168, 85, 247, 0.5) !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-around !important;
        align-items: center !important;
        z-index: 1000 !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: 0 -5px 15px rgba(0,0,0,0.8) !important;
    }

    .container > div:nth-of-type(3) .box {
        flex: 1 !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 5px !important;
        margin: 0 !important;
        cursor: pointer !important;
        position: static !important; /* Konieczne do wyśrodkowania popupu nad paskiem */
        contain: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        transform: none !important;
    }

    .container > div:nth-of-type(3) .box:hover {
        transform: none !important;
        box-shadow: none !important;
    }

    /* Ikony i Teksty zakładek */
    .container > div:nth-of-type(3) .box h2 {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 11px !important;
        color: #94a3b8 !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        text-shadow: none !important;
        gap: 4px !important;
        transition: all 0.3s ease !important;
    }

    .container > div:nth-of-type(3) .box.active-mobile-tab h2 {
        color: #39ff14 !important;
        text-shadow: 0 0 8px rgba(57, 255, 20, 0.5) !important;
    }

    .container > div:nth-of-type(3) .box h2 i,
    .container > div:nth-of-type(3) .box h2 img {
        font-size: 22px !important;
        width: 24px !important;
        height: 24px !important;
        margin: 0 !important;
        filter: grayscale(100%) opacity(0.7) !important; /* Szare gdy nieaktywne */
        transition: all 0.3s ease !important;
    }

    .container > div:nth-of-type(3) .box.active-mobile-tab h2 i,
    .container > div:nth-of-type(3) .box.active-mobile-tab h2 img {
        filter: grayscale(0%) opacity(1) !important; /* Kolorowe gdy aktywne */
    }

    /* Ukrywamy właściwą treść (Input, Discord) - pojawią się jako Popup */
    .container > div:nth-of-type(3) .box > form,
    .container > div:nth-of-type(3) .box > div:not(h2) {
        visibility: hidden !important;
        opacity: 0 !important;
        transform: translateY(100%) !important; /* Ukrycie na dole (poza ekranem) */
        position: fixed !important;
        bottom: 65px !important;
        left: 0 !important;
        width: 100% !important;
        background: rgba(20, 20, 25, 0.98) !important;
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        border-top: 1px solid rgba(168, 85, 247, 0.6) !important;
        border-radius: 20px 20px 0 0 !important;
        padding: 20px !important;
        box-shadow: 0 -10px 30px rgba(0,0,0,0.9) !important;
        z-index: 1001 !important;
        box-sizing: border-box !important;
        cursor: default !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important; /* Płynna animacja */
        pointer-events: none !important; /* Zapobiega przypadkowym kliknięciom w ukryty panel */
    }

    /* Wyskakujące panele, gdy zakładka jest kliknięta */
    .container > div:nth-of-type(3) .box.active-mobile-tab > form,
    .container > div:nth-of-type(3) .box.active-mobile-tab > div:not(h2) {
        visibility: visible !important;
        opacity: 1 !important;
        transform: translateY(0) !important; /* Wyjechanie na właściwą pozycję */
        pointer-events: auto !important; /* Przywrócenie klikalności */
    }
    
    .container > div:nth-of-type(3) .box.active-mobile-tab iframe {
        width: 100% !important;
        max-height: 65vh !important; /* Zwiększenie wysokości dla Discorda */
        border-radius: 8px !important;
    }

    /* 5. BOOSTEDY - Zmniejszenie i elastyczne pozycjonowanie na górze */
    .boosted-header-container {
        position: relative !important; /* Powrót do naturalnego spływania strony */
        top: 0 !important;
        width: 100% !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
        margin: 0 0 15px 0 !important; /* Odstęp od eventów pod spodem */
        padding: 0 10px !important;
        box-sizing: border-box !important;
    }

    .boosted-header-item {
        background: rgba(0, 0, 0, 0.6) !important;
        padding: 5px 8px !important;
        border-radius: 8px !important;
        border: 1px solid rgba(168, 85, 247, 0.3) !important;
        gap: 6px !important;
    }

    .boosted-header-item img {
        max-width: 24px !important;
        max-height: 24px !important;
    }

    .boosted-header-text strong {
        font-size: 11px !important;
    }
    
    .boosted-header-text {
        font-size: 9px !important;
    }

    /* 6. LOGO I AUTORYZACJA */
    .main-logo-container {
        position: fixed !important; /* Zmienione na fixed, by nie znikało w Burger Menu */
        left: 0 !important;
        width: 100% !important;
        top: 0 !important; /* Logo docelowo na samej górze ekranu */
        margin: 0 !important;
        z-index: 1001 !important;
    }
    
    .main-logo-container img {
        max-height: 50px !important; /* Bardzo małe logo żeby nie zabierało pół ekranu */
    }

    .top-right-auth {
        /* Ukrywamy oryginalne pływające menu na telefonach, bo przenieśliśmy je do zakładki */
        display: none !important;
    }

    .avatar {
        width: 36px !important;
        height: 36px !important;
    }

    /* Stylowanie zawartości zakładki konta w popupie mobilnym */
    .container > div:nth-of-type(3) .box.active-mobile-tab .account-popup {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 10px 0 20px 0 !important;
    }
    .container > div:nth-of-type(3) .box.active-mobile-tab .user-profile {
        flex-direction: column !important;
        text-align: center !important;
    }
    .container > div:nth-of-type(3) .box.active-mobile-tab .user-profile .avatar {
        width: 80px !important;
        height: 80px !important;
        margin-bottom: 5px !important;
    }
    .container > div:nth-of-type(3) .box.active-mobile-tab .btn-discord {
        padding: 12px 20px !important;
        font-size: 16px !important;
    }
    .container > div:nth-of-type(3) .box.active-mobile-tab .btn-discord img {
        width: 24px !important;
    }

    /* Poprawki do innych elementów psujących szerokość (np. podwójne boksy) */
    .boxes-wrapper {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    h1 {
        font-size: 18px !important;
        padding: 8px 15px !important;
        text-align: center !important;
    }

    h1 img {
        max-width: 40px !important;
    }

    /* 7. LEWE SZYBKIE LINKI (Poziomy pasek pod boosted) */
    .quick-links-container {
        display: flex !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        width: 100% !important;
        gap: 15px !important;
        margin: 1px 0 10px 0 !important; /* Odstęp od reszty strony */
    }

    .quick-links-container .quick-link {
        width: 42px !important;
        height: 42px !important;
        background: rgba(15, 15, 18, 0.4) !important; /* Bardziej przezroczyste tło przycisku */
        box-shadow: none !important; /* Usunięcie zielonej poświaty dla czystszego efektu */
    }

    .quick-links-container .quick-link img {
        max-width: 44px !important;
        max-height: 44px !important;
        filter: grayscale(100%) opacity(50%) !important; /* Czarno-białe i przezroczyste */
    }

    /* Wyłączenie tooltipów na telefonie, żeby nie wyskakiwały po kliknięciu i nie psuły układu */
    .quick-links-container .quick-link[data-tooltip]::after {
        display: none !important;
    }

    .right-sidebar-links {
        display: none !important; /* Ukrywamy boczne szybkie linki, żeby nie rozciągały strony na górze i nie psuły stałego dolnego paska */
    }

    .footer_cnt {
        padding-bottom: 100px !important; /* Dodatkowe miejsce dla stopki, żeby swobodnie wyjechała ponad dolny pasek na mobilce */
    }
}

/* --- ZGŁASZANIE BŁĘDÓW (BUG REPORT) --- */
.bug-report-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: rgba(220, 53, 69, 0.85);
    color: white;
    border: 2px solid #ff4d4d;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.5);
    transition: all 0.3s ease;
}
.bug-report-btn:hover {
    transform: scale(1.1);
    background: #dc3545;
    box-shadow: 0 0 25px rgba(220, 53, 69, 0.8);
}
.bug-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}
.bug-modal-overlay.active {
    display: flex;
}
.bug-modal-content {
    background: rgba(15, 15, 18, 0.95);
    border: 1px solid rgba(168, 85, 247, 0.5);
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    position: relative;
}
.bug-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #ff4444;
    font-size: 28px;
    cursor: pointer;
    background: none;
    border: none;
}
.bug-modal-content h3 {
    color: #39ff14;
    margin-top: 0;
    margin-bottom: 15px;
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.4);
}
.bug-modal-content textarea {
    width: 100%;
    min-height: 100px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(168, 85, 247, 0.5);
    border-radius: 6px;
    color: #fff;
    padding: 10px;
    box-sizing: border-box;
    margin-bottom: 15px;
    resize: vertical;
}

.bug-modal-content button.submit-bug {
    width: 100%;
    padding: 10px;
    background: #39ff14;
    color: #000;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
}
.bug-modal-content button.submit-bug:hover {
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.6);
}

.rank-map-editor {
    background: rgba(0, 229, 255, 0.15);
    color: #00e5ff;
    border: 1px solid #00e5ff;
}

/* Spinner ładowania do importu mapy */
.import-spinner {
    border: 4px solid rgba(168, 85, 247, 0.3);
    border-top: 4px solid #39ff14; /* Neonowa zieleń z motywu ThePresja */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 15px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.import-processing-text {
    color: #39ff14;
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
    animation: pulse 1.5s infinite;
}

/* Poprawka dla ucinających się list rozwijanych w oknach dialogowych (np. TinyMCE autocomplete) */
.tox-tinymce-aux, .tox-dialog__body-content, .tox-dialog, .tox-dialog__body {
    overflow: visible !important;
}

/* --- WEAPON PROFICIENCY MODULE --- */
.proficiency-main-container {
    margin: 30px auto;
    width: 1018px; /* Skorygowana szerokość do pełnego wymiaru UI */
    height: 580px; /* Zwiększona wysokość, aby na pewno nie ucinało dołu */
    position: relative;
    background-image: url('/images/prof.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center top;
    border: none; /* Grafika ma własne obramowanie */
}

/* Tekst "You see..." widoczny wewnątrz panelu Proficiency */
.proficiency-see-label {
    position: absolute;
    width: 200px;
    top: 150px;
    left: 18px;
    color: #39ff14;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000, 0 0 5px rgba(57, 255, 20, 0.3);
    z-index: 11;
    line-height: 1.2;
    pointer-events: none; /* Tekst nie blokuje interakcji */
    text-align: center;
}

.proficiency-weapon-icon-container {
    position: absolute;
    top: 60px;
    left: 45px;
    width: 54px;
    height: 54px;
    z-index: 10;
    margin-left: 45px;
    cursor: help;
}

/* Ikona aktualnie wybranej broni wewnątrz kontenera */
.proficiency-weapon-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.6));
}

/* Własny tekst opisu wewnątrz panelu Proficiency */
.proficiency-custom-text {
    position: absolute;
    top: 85px;
    left: 2px;
    width: 230px;
    color: #39ff14;
    font-size: 9px;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.4), 2px 2px 4px #000;
    z-index: 1; /* Obniżono, aby toolipy perków (z siatki) były nad tekstem */
    pointer-events: none; /* Tekst nie blokuje kliknięć w perki pod spodem */
    margin-top: 100px;
    line-height: 1.5; /* Lepsza czytelność przy tekście z <br> */
}

.proficiency-grid {
    position: relative;
    z-index: 2; /* Wyżej niż proficiency-custom-text, aby tooltipy nie były przykryte */
    display: grid;
    grid-template-columns: repeat(7, 105px); /* Stała szerokość każdej kolumny */
    column-gap: 1px;    /* Odstęp między kolumnami dopasowany do linii na grafice */
    margin-left: 244px; /* Przesunięcie całej siatki w prawo/lewo */
    margin-top: 80px;  /* Przesunięcie całej siatki w górę/dół */
    width: 745px;
    height: 355px;
}

/* --- NOWY STAŁY PASEK NAWIGACYJNY (TOPBAR) --- */
.fixed-topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px; /* Wysokość paska */
    background: rgba(15, 15, 18, 0.98); /* Ciemne tło */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(168, 85, 247, 0.5); /* Fioletowa ramka na dole */
    z-index: 1500; /* Zapewnia, że pasek jest zawsze na wierzchu */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.8);
}

.topbar-logo {
    display: flex;
    align-items: center;
    height: 100%;
}

.topbar-logo img {
    height: 50px; /* Rozmiar mini logo */
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.4));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.topbar-logo img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 15px rgba(57, 255, 20, 0.8));
}

.topbar-boosted {
    display: flex;
    gap: 20px;
    align-items: center;
}

.topbar-boosted .boosted-header-item {
    /* Ponowne użycie istniejących stylów, ale dostosowanie rozmiarów */
    position: static; /* Usuwamy pozycjonowanie absolutne */
    top: auto;
    left: auto;
    transform: none; /* Usuwamy poprzednie transformacje */
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.topbar-boosted .boosted-header-item:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 12px rgba(57, 255, 20, 0.7));
}

.topbar-boosted .boosted-header-item img {
    max-width: 40px; /* Mniejsze ikony dla topbara */
    max-height: 40px;
}

.topbar-boosted .boosted-header-text strong {
    font-size: 12px; /* Mniejszy tekst */
}

.topbar-boosted .boosted-header-text span {
    font-size: 9px; /* Jeszcze mniejszy podtytuł */
}

.topbar-auth {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0; /* Gwarantuje, że profil nie zostanie zgnieciony */
}

.topbar-auth .user-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.1;
}

.topbar-auth .user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.topbar-auth .avatar {
    width: 36px; /* Mniejszy avatar */
    height: 36px;
}

.topbar-auth .username {
    font-size: 16px; /* Mniejsza nazwa użytkownika */
}

.topbar-auth .user-dropdown-content {
    top: calc(100% + 10px); /* Odstęp od paska */
    right: 0; /* Wyrównanie do prawej krawędzi kontenera profilu */
    z-index: 2000;
}

.topbar-auth .user-menu-toggle {
    display: flex !important; /* Przywracamy flex, aby strzałka była wycentrowana */
    align-items: center;
    color: #39ff14;
    margin-left: 2px;
    font-size: 18px; /* Zapewniamy, że ikona strzałki ma widoczny rozmiar */
}

.topbar-auth .user-menu-toggle i {
    display: block; /* Upewniamy się, że sama ikona jest renderowana jako blok */
}

.topbar-auth .btn-logout {
    /* Ten styl jest przeznaczony dla starego, samodzielnego przycisku "Wyloguj".
       Upewnij się, że link do wylogowania znajduje się wewnątrz .user-dropdown-content
       i ma klasę np. .stream-link-item, a nie .btn-logout.
       Jeśli nadal widzisz "Wyloguj" poza menu, sprawdź HTML w index.ejs. */
    display: none; /* Pozostawiamy to, aby ukryć wszelkie pozostałości starego przycisku */
}

/* Dostosowanie marginesu głównego kontenera, aby zawartość nie była ukryta pod topbarem */
body .container {
    margin-top: 55px; /* Wysokość topbara (50px) */
}

/* Ukrywamy oryginalne elementy, które zostały przeniesione do topbara */
.main-logo-container,
.boosted-header-container,
.top-right-auth {
    display: none;
}

/* --- RESPONSIVE MOBILE LAYOUT DLA TOPBARA --- */
@media (max-width: 900px) {
    .fixed-topbar {
        height: 60px; /* Nieco mniejszy na urządzeniach mobilnych */
        padding: 0 10px;
        box-sizing: border-box;
    }

    .topbar-logo img {
        height: 40px;
    }

    .topbar-boosted {
        gap: 10px; /* Mniejszy odstęp na urządzeniach mobilnych */
    }

    .topbar-boosted .boosted-header-item img {
        max-width: 30px;
        max-height: 30px;
    }

    .topbar-boosted .boosted-header-text {
        display: none; /* Ukrywamy tekst na urządzeniach mobilnych, aby zaoszczędzić miejsce */
    }

    .topbar-auth .avatar {
        width: 25px;
        height: 25px;
    }

    .topbar-auth .username,
    .topbar-auth .btn-logout {
        display: none; /* Ukrywamy nazwę użytkownika i tekst wylogowania na urządzeniach mobilnych */
    }

    .topbar-auth .btn-discord {
        padding: 4px 8px;
        font-size: 11px;
    }

    .topbar-auth .btn-discord img {
        width: 14px;
    }

    body .container {
        margin-top: 60px; /* Dostosowujemy margines kontenera dla mniejszego topbara mobilnego */
    }

    /* Zapewniamy, że mobilny przycisk burgera jest nadal widoczny i nie jest ukryty przez topbar */
    .mobile-burger-btn {
        top: 10px !important;
        left: 10px !important;
        z-index: 1501 !important; /* Wyżej niż topbar */
    }
}

/* --- WIDOCZNOŚĆ CHANGELOGU (NEWSÓW) --- */
/* Domyślnie ukrywamy sekcję newsów na wszystkich podstronach */
.news-section, .changelog-box {
    display: none;
}

/* Pokazujemy newsy tylko na stronie głównej (zakładając, że body ma klasę .page-home) */
.page-home .news-section, .page-home .changelog-box {
    display: block;
}

.proficiency-column {
    background: transparent; /* Usuwamy tło, bo jest już na obrazku prof.PNG */
    border: none;           /* Usuwamy ramki, aby nie nakładały się na te z grafiki */
    border-radius: 12px;
    position: relative; /* Wymagane dla poprawnego działania z-index */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Rozpycha perki maksymalnie od siebie */
    align-items: center;
    transition: all 0.3s ease;
    padding: 30px 0; /* Zmieniono z błędnej ujemnej wartości na poprawną */
    margin-left: -20px;
    margin-top: 0px;
    top: -62px;
}

.proficiency-column:hover {
    z-index: 100; /* Wysuwa całą kolumnę nad sąsiednie podczas najechania myszką */
}

/* Jeśli w kolumnie jest tylko 1 perk, wyśrodkuj go pionowo */
.proficiency-column .perk-item:first-child:last-child {
    margin: auto 0;
}

/* Jeśli w kolumnie są dokładnie 2 perki: pierwszy niżej, drugi wyżej */
/* Te selektory działają TYLKO gdy w kolumnie są dokładnie 2 elementy */
.proficiency-column .perk-item:first-child:nth-last-child(2),
.proficiency-column .perk-item:first-child:nth-last-child(2) ~ .perk-item {
    margin-top: 45px;
    margin-bottom: 45px;
}


/* Ustawienia przesunięcia dla poszczególnych kolumn (X, Y) */
.proficiency-column:nth-child(1) { transform: translate(0px, 0px); }
.proficiency-column:nth-child(2) { transform: translate(4px, 0px); }
.proficiency-column:nth-child(3) { transform: translate(7px, 0px); }
.proficiency-column:nth-child(4) { transform: translate(12px, 0px); }
.proficiency-column:nth-child(5) { transform: translate(15px, 0px); }
.proficiency-column:nth-child(6) { transform: translate(21px, 0px); }
.proficiency-column:nth-child(7) { transform: translate(24px, 0px); }

.proficiency-column.active {
    background: rgba(45, 45, 52, 0);
    border-color: rgba(169, 85, 247, 0);
    box-shadow: 0 0 15px rgba(169, 85, 247, 0);
}

.proficiency-column.inactive {
    opacity: 0.3;
    filter: grayscale(100%);
    pointer-events: none; /* Blokuje dodawanie perków */
}

.perk-item {
    position: relative;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    background-image: url('/images/ramka.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    image-rendering: pixelated; /* Zapobiega rozmyciu ramki */
}

.perk-item:hover {
    transform: scale(1.1);
    z-index: 10000; /* Wyciąga aktywny perk i jego tooltip ponad wszystkie inne ikony, kolumny i opisy */
}

.perk-icon {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
    cursor: help;
    filter: drop-shadow(0 0 8px rgba(57, 255, 20, 0.4));
}

/* Mała dodatkowa ikona w prawym górnym rogu perka */
.perk-sub-icon {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 20px;
    height: 20px;
    image-rendering: pixelated;
    z-index: 5;
    filter: drop-shadow(1px 1px 2px #000);
}

/* Specyficzny styl tooltipa dla modułu Proficiency, zgodny z .proficiency-custom-text */
.proficiency-main-container [data-tooltip]::after {
    color: #39ff14 !important;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.4), 2px 2px 4px #000;
    z-index: 9999999;
}

/* --- ADMIN PROFICIENCY EDITOR --- */
.proficiency-editor-controls {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(168, 85, 247, 0.1);
    padding: 15px;
    border-radius: 8px;
}

.admin-perk-slot {
    width: 100%;
    padding: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    border-top: 1px dashed rgba(168, 85, 247, 0.2);
}

.admin-perk-icon-preview {
    width: 32px;
    height: 32px;
    background: #000;
    border: 1px solid #a855f7;
    cursor: pointer;
}

.admin-perk-desc {
    width: 90%;
    font-size: 10px;
    background: rgba(0,0,0,0.5);
    border: 1px solid #333;
    color: #ccc;
    padding: 2px;
}

.btn-add-perk {
    background: none;
    border: 1px solid #39ff14;
    color: #39ff14;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    line-height: 18px;
}


/* Skalowanie względem szerokości panelu */
.proficiency-scale-wrapper {
    transform: scale(calc(min(1, 100vw / 1018)));
}
.proficiency-scroll-wrapper {
    width: 100%;
    height: 100%;
    overflow: auto; /* scroll działa */
    display: flex;
    justify-content: center;
}
.proficiency-main-container {
    width: 1018px;
    height: 580px;
    min-width: 1018px;
    min-height: 580px;
}

.proficiency-grid {
    width: 745px;
    height: 355px;
    min-width: 745px;
    min-height: 355px;
}







/* --- BESTIARY GRID & CARDS --- */
.bestiary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    padding: 10px;
}

.bestiary-card {
    background: rgba(15, 15, 18, 0.6);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 12px;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.bestiary-card:hover {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
    transform: translateY(-3px);
}

.bestiary-points {
    position: absolute;
    top: 5px;
    right: 8px;
    font-size: 10px;
    color: #a855f7;
    font-weight: bold;
}

.bestiary-name {
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
    margin: 10px 0 5px 0;
}

.bestiary-progress-container {
    width: 80%;
    height: 4px;
    background: rgba(0,0,0,0.5);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 5px;
}

.bestiary-progress-bar {
    height: 100%;
    background: #a855f7;
    transition: width 0.3s ease;
}

.bestiary-progress-bar.finished {
    background: #39ff14;
    box-shadow: 0 0 5px rgba(57, 255, 20, 0.5);
}

.bestiary-kills-info {
    font-size: 10px;
    color: #94a3b8;
}

.bestiary-corner-icon {
    position: left;
    top: -12px;
    left: -12px;
    z-index: 10;
}

.bestiary-corner-icon img {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.5));
    transition: transform 0.2s ease;
}

.bestiary-corner-icon img:hover {
    transform: scale(1.12);
}

/* --- KLASA INFORMACYJNA (ZŁOTA) --- */
.info-note {
    position: relative;
    background: rgba(15, 15, 18, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(212, 172, 13, 0.3);
    border-left: 4px solid #d4ac0d;
    border-radius: 8px;
    padding: 12px 35px 12px 16px;
    margin: 10px 0;
    color: #d4ac0d;
    font-size: 11px;
    font-weight: 500;
    text-shadow: 0 0 5px rgba(212, 172, 13, 0.2);
    line-height: 1.5;
}

.info-note::before {
    content: 'ℹ';
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 18px;
    font-weight: bold;
    filter: drop-shadow(0 0 5px rgba(212, 172, 13, 0.4));
}
