/* --- 1. IMPORT MODERNÍHO FONTU --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

/* --- 2. PROMĚNNÉ (Barvičky) --- */
:root {
  --primary: #6366f1;       /* Indigo - Hlavní barva */
  --primary-hover: #4f46e5;
  --accent: #a855f7;        /* Fialová - Doplňková */
  --gold: #ffd900;          /* Zlatá na hvězdy */
  --text-main: #ffffff;
  --text-muted: #a1a1aa;
  
  /* Glassmorphism nastavení */
  --glass-bg: rgba(15, 15, 20, 0.65); /* Průhledná tmavá */
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 12px;
}

* { box-sizing: border-box; 
  -webkit-tap-highlight-color: transparent !important;

}
/* --- 3. POZADÍ A BODY --- */
html, body {
  margin: 0;
  height: 100%;
  min-height: 100vh;
  font-family: 'Outfit', system-ui, sans-serif; /* Moderní font */
  color: var(--text-main);
  background-color: #050505; /* Fallback barva */
}

body {
  /* Placeholder, skutečný background přidáváme po načtení v JS kvůli rychlejšímu first paint */
  background: linear-gradient(180deg, #0b0c11 0%, #0c0f1a 40%, #050505 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  transition: background 0.4s ease;
  overflow-x: hidden;
}

/* --- 4. NAVIGACE --- */
/* --- NAVIGACE (Upravená - Výraznější) --- */
nav {
  display: flex;
  justify-content: center;
  gap: 12px; /* Větší mezera mezi tlačítky */
  padding: 0;
  position: static;
  background: transparent;
  box-shadow: none;
}
.hdr { border-bottom: none; }
.hdr {
  position: sticky;
  top: 0;
  z-index: 100;
  background: transparent;
  backdrop-filter: none;
  border: none;
  box-shadow: none;
  padding-top: 0;
}
.hdr-inner {
  max-width: 1600px;
  width: calc(100% - 40px);
  margin: 0 auto 10px auto;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}
.hdr-left {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.1), transparent 35%), rgba(7, 7, 12, 0.6);
  backdrop-filter: blur(10px) saturate(120%);
  border: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  border-radius: 16px;
}
.hdr-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.hdr-right-glass {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.1), transparent 35%), rgba(7, 7, 12, 0.6);
  backdrop-filter: blur(10px) saturate(120%);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.brand-wrap { display: flex; align-items: center; gap: 10px; }
.brand-title { font-weight: 800; font-size: 20px; color: #ffd900; text-decoration: none; }
.hdr nav {
  flex: 1;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: none;
  position: static;
  justify-content: flex-start;
  gap: 12px;
}
.tabs { display: flex; gap: 12px; flex: 0 1 auto; justify-content: flex-start; }
.tabs-secondary {
  padding: 0;
  background: transparent;
  box-shadow: none;
  align-items: center;
}
.header-actions { gap: 8px; display: flex; align-items: center; flex: 0 0 auto; padding: 0; background: transparent; border: none; box-shadow: none; margin-left: 0; }

.tab {
  text-decoration: none;
  color: #ccc; /* Světlejší šedá pro neaktivní */
  padding: 10px 24px;
  border-radius: 12px; /* Hranatější nebo kulaté, jak chceš */
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03); /* Jemné pozadí i pro neaktivní */
}

/* Hover efekt (když na to najedeš myší) */
.tab:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px); /* Jemné nadzvednutí */
}

/* AKTIVNÍ TLAČÍTKO (To důležité) */
.tab.active {
  color: white;
  /* Použijeme tvou hlavní barvu (Indigo) */
  background: var(--primary); 
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  
  /* Záře kolem tlačítka */
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  border-color: transparent;
}


/* --- 5. HLAVNÍ KONTEJNER --- */
#app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
  flex-grow: 1;
}

/* --- 6. KARTY (GLASS STYLE) --- */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)); /* To dělá to rozmazání za kartou */
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.card.pad { padding: 24px; }
.card.center { text-align: center; align-items: center; display: flex; flex-direction: column; }

/* Hover efekt na kartách */
.card[role="button"]:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* GRID */
.grid { display: grid; gap: 20px; }
.grid.srv { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* --- 7. OBSAH KARET --- */
.srv-logo {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  object-fit: contain;
  background: rgba(0,0,0,0.3);
  padding: 10px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.3s;
}

.card:hover .srv-logo { transform: scale(1.05); }

.srv-name {
  font-size: 20px;
  font-weight: 700;
  color: #fff !important;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.muted {
  color: var(--text-muted);
  font-size: 15px; /* Změněno z 13px na 15px pro lepší čitelnost */
  line-height: 1.6; /* Větší řádkování, aby se text nesléval */
}

/* --- 8. TLAČÍTKA & INPUTY --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn:hover { background: rgba(255,255,255,0.15); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border: none;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}
.btn-join { width: 100%; margin-top: 12px; }
.btn-sm { padding: 6px 12px; font-size: 12px; min-width: 45px; }

/* Inputy */
.input, textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: 0.2s;
}
.input:focus {
  background: rgba(0, 0, 0, 0.5);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
.input::placeholder { color: #666; }

.glow-select {
  position: relative;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 0 0 1px rgba(99,102,241,0.2), 0 0 12px rgba(99,102,241,0.25);
  animation: glowPulse 6s linear infinite;
}
@keyframes glowPulse {
  0% { box-shadow: 0 0 0 1px rgba(99,102,241,0.2), 0 0 12px rgba(99,102,241,0.25); }
  50% { box-shadow: 0 0 0 1px rgba(168,85,247,0.25), 0 0 16px rgba(168,85,247,0.35); }
  100% { box-shadow: 0 0 0 1px rgba(99,102,241,0.2), 0 0 12px rgba(99,102,241,0.25); }
}

.dropdown { position: relative; }

.dropdown-btn {
  cursor: pointer;
  display: flex;           /* Flexbox */
  align-items: center;
  justify-content: space-between; /* Text vlevo, šipka vpravo */
  gap: 8px;
  white-space: nowrap;
}
.dropdown-btn .caret { margin-left: 8px; opacity: 0.7; }
.dropdown-menu {
  position: absolute;
  top: 110%;
  right: 0;
  min-width: 180px;
  background: rgba(10,10,14,0.95);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 15px 35px rgba(0,0,0,0.45);
  border-radius: 10px;
  padding: 6px;
  z-index: 40;
  max-height: 260px;
  overflow-y: auto;
  animation: glowPulse 6s linear infinite;
}
.dropdown-menu.hidden { display: none; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.dropdown-item:hover { background: rgba(255,255,255,0.06); transform: translateX(2px); }
.dropdown-logo { width: 18px; height: 18px; border-radius: 6px; object-fit: contain; }

/* --- 9. HVĚZDIČKY (Public & Admin) --- */
.stars { display: inline-flex; gap: 2px; }
.rating-line { margin: 8px 0; }

/* Veřejné (statické) */
.stars.static .star {
  font-size: 18px;
  color: #444;
  cursor: default;
}
.stars.static .star.filled {
  color: var(--gold);
  text-shadow: 0 0 8px rgba(255, 217, 0, 0.4); /* Neon záře */
}
.stars.static .star.half {
  background: linear-gradient(90deg, var(--gold) 50%, #444 50%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 8px rgba(255, 217, 0, 0.35);
}

/* Admin (klikací) */
.admin-stars {
  display: inline-flex; gap: 6px; cursor: pointer;
  font-size: 32px; user-select: none;
}
.admin-stars .star { color: #333; transition: 0.15s; }
.admin-stars .star.active { color: var(--gold); }
.admin-stars .star:hover { transform: scale(1.2); color: #ffe066; }

/* --- 10. DALŠÍ PRVKY --- */
.progress {
  height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; margin-top: 6px;
}
.progress i {
  display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent));
}

.chip {
  display: inline-block;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.05);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #ddd;
}

.chip.icon-chip {
  padding: 4px 8px;
  font-size: 13px;
  line-height: 1;
}

/* Admini & Avataři */
.avatar {
  width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.1);
}
.avatar-lg {
  width: 90px; height: 90px; border-radius: 50%; border: 3px solid var(--primary);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.25);
}

/* Utility */
.row { display: flex; gap: 10px; align-items: center; }
.grow { flex-grow: 1; }
.hidden { display: none !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

/* Footer */
footer {
  text-align: center; padding: 30px; color: var(--text-muted); font-size: 12px; border-top: 1px solid var(--glass-border);
}
.footer-link {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  padding: 0 4px;
  font-size: 12px;
}

/* Logo vlevo nahoře */
.brand {
  font-weight: 700;
  font-size: 18px;
  color: white;          /* Bílá barva */
  text-decoration: none; /* Žádné podtržení */
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;       /* Ručička myši */
  transition: opacity 0.2s;
  padding-left: 3vh;
}

.brand:hover {
  opacity: 0.8;         /* Jemný efekt při najetí */
}

/* --- TLAČÍTKO "PŘIPOJIT SE" (NEON STYL) --- */
.btn-neon-connect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
  
  /* Původní barvy z buttons.cool */
  color: #fff;
  background-color: #0d1117;
  border: 1px solid #30363d;
  box-shadow: 0 0 0 0 rgba(100, 150, 250, 0); /* Počáteční stín */
}

/* Neonový efekt rámečku */
.btn-neon-connect::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #a855f7, #6366f1, #38bdf8, #a855f7); /* Barevný gradient */
  background-size: 400% 400%;
  z-index: -1;
  filter: blur(8px); /* Rozmazání záře */
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  border-radius: 12px;
}

/* Text uvnitř tlačítka, aby byl nad neonovým rámečkem */
.btn-neon-connect span {
  position: relative;
  z-index: 1;
  display: flex; /* Pro zarovnání SVG a textu */
  align-items: center;
  gap: 8px; /* Mezera mezi ikonou a textem */
}

/* Hover efekt */
.btn-neon-connect:hover {
  color: #fff;
  background-color: #161b22;
  border-color: #8b949e;
  box-shadow: 0 0 20px rgba(100, 150, 250, 0.4); /* Větší stín při najetí */
  transform: translateY(-2px);
}

.btn-neon-connect:hover::before {
  opacity: 1;
  animation: neonGlow 8s ease-in-out infinite; /* Animace záře */
}

/* Animace pro neonový rámeček */
@keyframes neonGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Ikona SVG uvnitř tlačítka */
.btn-neon-connect svg {
  width: 20px; /* Větší ikona */
  height: 20px;
  transition: transform 0.2s;
}

.btn-neon-connect:hover svg {
  transform: scale(1.1); /* Ikona se při najetí lehce zvětší */
}


/* --- Větší logo serveru na detailní stránce --- */
.srv-logo-lg {
  width: 120px; /* Větší rozměr */
  height: 120px;
  object-fit: contain; /* Ponechat "contain" pro loga, ať se nedeformují */
  border-radius: 20px; /* Trochu víc zaoblené */
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); /* Výraznější stín */
  transition: transform 0.3s;
}

/* Aby se zvětšilo i při najetí myši */
.card:hover .srv-logo-lg { transform: scale(1.03); }

/* Odstranění původního .srv-logo z detailu serveru, pokud by tam bylo */
.server-detail .srv-logo { display: none; }



/* --- RECENZE --- */
.review-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
}

/* --- STYLY PRO RECENZE --- */
.review-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  margin-bottom: 10px;
}

/* Admin recenze - Zlatý rámeček */
.admin-review {
  border: 1px solid rgba(255, 217, 0, 0.3);
  background: linear-gradient(to right, rgba(255, 217, 0, 0.05), transparent);
}

.review-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-author {
  font-weight: bold;
  color: #fff;
  font-size: 15px;
}

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

.review-content {
  line-height: 1.6;
  color: #e0e0e0;
  font-size: 14px;
}
.review-content strong {
  font-size: 1.58em;
  font-weight: 800;
}

/* Avatar placeholder pro admin recenzi (písmeno R) */
.avatar-placeholder {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #ffd900;
  color: #000;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold;
  font-size: 20px;
  box-shadow: 0 0 10px rgba(255, 217, 0, 0.3);
}

/* Styl pro uživatelskou recenzi, kterou napsal Admin */
.admin-staff-review {
  border: 1px solid rgba(255, 217, 0, 0.2); /* Jemný zlatý okraj */
  background: rgba(255, 215, 0, 0.03); /* Velmi jemné zlaté pozadí */
}

.quality-badge-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  margin-top: -6px;
  margin-left: -6px;
}

.quality-badge-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.quality-badge-tooltip {
  position: absolute;
  left: 110%;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
  width: 260px;
  display: none;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.quality-badge-tooltip-img {
  width: 220px;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
}

.quality-badge-box:hover .quality-badge-tooltip {
  display: flex;
}

.quality-badge-small {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  filter:
    drop-shadow(0 0 4px rgba(0,0,0,0.4))
    drop-shadow(0 0 10px rgba(255, 215, 0, 0.9))
    drop-shadow(0 0 18px rgba(255, 215, 0, 0.8));
}

.srv-name-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.srv-name-wrap .srv-name {
  display: inline-block;
  text-align: center;
}

.srv-name-wrap .quality-badge-small {
  position: absolute;
  right: -30px;
  top: 50%;
  transform: translateY(-50%);
}

.vote-logo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center; /* Vycentrovat obsah (ikonu i číslo) */
  gap: 6px;
  
  /* TOTO JE KLÍČOVÉ: Nastavíme minimální šířku */
  min-width: 70px; /* Uprav hodnotu podle potřeby (60px - 80px je ideál) */
  
  /* Aby se tlačítko nezvětšovalo zbytečně moc */
  padding: 8px 12px; 
  
  /* Pokud chceš, aby byla VŠECHNA tlačítka stejně široká bez ohledu na číslo (i 9999), 
     můžeš dát width místo min-width, ale min-width je bezpečnější. */
}

.vote-logo {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: url("img/logo.png") center/contain no-repeat;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.35));
}
.vote-logo-down { transform: rotate(90deg); }
.vote-logo-up { transform: rotate(-90deg); }

/* Tlačítka pro editaci */
.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* Mobil */
@media (max-width: 600px) {
  .grid.srv { grid-template-columns: 1fr; }
  nav { overflow-x: auto; justify-content: flex-start; padding: 15px; }
  .row { flex-wrap: wrap; }
}


/* Nový vzhled/animace brand sekce */
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  padding-left: 0;
  transition: opacity 0.2s, transform 0.2s;
}

.brand-logo {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  animation: brandLogoIn 1.3s ease forwards;
  transform-origin: center;
}

.brand-title {
  font-weight: 800;
  font-size: 20px;
  color: rgb(255, 220, 14); /* Požadovaná barva */
  text-decoration: none;
  letter-spacing: 0.04em;
  animation: brandTextIn 1.3s ease 0.12s forwards;
  opacity: 0;
}

.brand-wrap:hover {
  opacity: 0.9;
  transform: translateX(-1px);
}

@keyframes brandLogoIn {
  from { transform: rotate(90deg) translateX(-12px); opacity: 0; }
  to   { transform: rotate(0deg) translateX(0); opacity: 1; }
}

@keyframes brandTextIn {
  from { transform: translateX(-12px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* Modal */
.modal-root {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.modal-root.hidden { display: none; }
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
}
.modal-box {
  position: relative;
  background: rgba(10,10,14,0.92);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
  max-width: 800px;
  max-height: 75vh;
  width: 90%;
  z-index: 1;
  text-align: center;
  overflow-y: auto;
}
.modal-message {
  font-size: 16px;
  margin-bottom: 16px;
  color: #fff;
}
.modal-btn {
  min-width: 120px;
}
.modal-title {
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
}
.modal-close:hover { opacity: 1; }


.bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  z-index: -1;
  pointer-events: none;
}
.bg-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.7));
  display: none;
  z-index: -1;
  pointer-events: none;
}
body.fancy-mode .bg-video { display: block; }
body.fancy-mode .bg-overlay { display: block; }
body.fancy-mode { background-image: none; }
.fancy-toggle-floating {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 200;
}
.fancy-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
}
.fancy-switch input { display: none; }
.fancy-switch .slider {
  position: relative;
  width: 46px;
  height: 24px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.2s ease;
}
.fancy-switch .slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffd900;
  box-shadow: 0 0 12px rgba(255, 217, 0, 0.6);
  transition: all 0.2s ease;
}
.fancy-switch input:checked + .slider {
  background: rgba(255, 217, 0, 0.2);
  border-color: rgba(255, 217, 0, 0.6);
}
.fancy-switch input:checked + .slider::after {
  transform: translateX(22px);
}
.fancy-switch .label {
  color: #fff;
  font-weight: 600;
}

.star-picker {
  display: inline-flex;
  gap: 4px;
  margin: 8px 0;
}
.star-picker .star-full {
  font-size: 22px;
  color: #333;
  cursor: pointer;
  transition: transform 0.1s, color 0.1s;
  -webkit-text-fill-color: currentColor;
  -webkit-text-stroke: 1px transparent;
}
.star-picker .star-full.active {
  color: var(--gold);
  text-shadow: 0 0 6px rgba(255, 217, 0, 0.6);
}
.star-picker .star-full.half {
  background: linear-gradient(90deg, var(--gold) 50%, #333 50%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 6px rgba(255, 217, 0, 0.6);
}
.star-picker .star-full:hover {
  transform: scale(1.15);
}

/* Spinner s logem */
.loader-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo-spinner {
  width: 28px;
  height: 28px;
  background: url("/img/logo.png") center/contain no-repeat;
  filter: drop-shadow(0 0 6px rgba(255, 217, 0, 0.35));
  animation: pulseLogo 1.4s ease-in-out infinite;
}
.logo-spinner.large {
  width: 64px;
  height: 64px;
  animation-duration: 1.6s;
}

@keyframes pulseLogo {
  0% { transform: scale(1); opacity: 0.8; }
  40% { transform: scale(1.08); opacity: 1; }
  70% { transform: scale(0.98); opacity: 0.9; }
  100% { transform: scale(1); opacity: 0.85; }
}

.page-loader {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(5, 5, 8, 0.75);
  backdrop-filter: blur(8px);
  z-index: 3000;
  transition: opacity 0.2s ease;
  padding: 24px;
}
.page-loader.hidden {
  opacity: 0;
  pointer-events: none;
}
.loader-title {
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  text-shadow: 0 0 12px rgba(255, 217, 0, 0.5);
}
.loader-bar {
  width: min(320px, 70vw);
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
  position: relative;
}
.loader-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,217,0,0.1), rgba(255,217,0,0.8), rgba(255,217,0,0.1));
  width: 45%;
  border-radius: 999px;
  animation: slideBar 1.6s ease-in-out infinite;
}
@keyframes slideBar {
  0% { transform: translateX(-50%); }
  50% { transform: translateX(120%); }
  100% { transform: translateX(-50%); }
}

#loginBtn i {
  margin-right: 8px;
  display: inline-block; /* kvůli rotaci */
}

/* jen jednou se protočí při hoveru */
#loginBtn:hover i {
  animation: discord-spin 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* trochu “fancy” spin se zvětšením a lehkým cuknutím zpět */
@keyframes discord-spin {
  0% {
    transform: rotate(0deg) scale(1);
  }
  40% {
    transform: rotate(220deg) scale(1.15);
  }
  70% {
    transform: rotate(350deg) scale(0.97);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}



/* --- MOBILNÍ OPTIMALIZACE --- */
@media (max-width: 900px) {
  /* 1. Rozložit hlavičku pod sebe */
  .hdr-inner {
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 10px;
    align-items: center; /* Zarovnat vše na střed */
  }

  /* 2. Zarovnat a roztáhnout sekce hlavičky */
  .hdr-left, 
  .hdr-right,
  .hdr-right-glass {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap; /* Aby se tlačítka zalomila, když je jich moc */
  }

  /* 3. Logo a název */
  .brand-wrap {
    width: 100%;
    justify-content: center;
    margin-bottom: 8px;
  }

  /* 4. Navigace (scrollovací do boku, aby se vešla) */
  nav.tabs {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    justify-content: flex-start; /* Začátek zleva pro scrollování */
    padding-bottom: 5px; /* Místo pro scrollbar */
    -webkit-overflow-scrolling: touch; /* Plynulé scrollování na iOS */
  }
  
  /* Skrytí scrollbaru u navigace */
  nav.tabs::-webkit-scrollbar {
    display: none;
  }

  /* 5. Tlačítka vpravo */
  .header-actions {
    width: 100%;
    justify-content: center;
    margin-top: 5px;
  }

  /* 6. Upravit grid serverů na 1 sloupec */
  .grid.srv {
    grid-template-columns: 1fr;
  }

  /* 7. Fancy toggle posunout, aby nezavazel */
  .fancy-toggle-floating {
    bottom: 10px;
    right: 10px;
    transform: scale(0.9); /* Zmenšit na mobilu */
  }
}


/* --- SKRÝT FANCY MODE NA MOBILECH --- */
@media (max-width: 768px) {
  .fancy-toggle-floating {
    display: none !important;
  }
}


/* =========================================
   FINÁLNÍ OPRAVA KARET (BADGE UPROSTŘED)
   ========================================= */

/* --- 1. MOBILNÍ ZOBRAZENÍ (< 768px) --- */
@media (max-width: 768px) {
    .card.srv-card {
        display: grid !important;
        /* Logo (55px) | Info (flex) | Badge (40px) | Voty (auto) */
        grid-template-columns: 55px 1fr 40px auto !important; 
        align-items: center !important;
        padding: 10px 14px !important;
        gap: 8px !important; /* Menší mezera mezi sloupci */
        text-align: left !important;
        min-height: 80px;
    }

    /* A) LOGO */
    .srv-card .srv-logo {
        width: 80px !important;
        height: 80px !important;
        margin: 0 !important;
        border-radius: 12px !important;
        padding: 3px !important;
        background: rgba(0,0,0,0.3);
        align-self: center;
    }

    /* B) INFO (Texty) */
    .srv-card .srv-info-container {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start !important;
        min-width: 0;
        gap: 2px;
        padding-left: 25px;
    }
    
    .srv-card .srv-name {
        font-size: 15px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: #fff !important;
        margin-bottom: 2px;
        line-height: 1.2;
    }

    .rating-line { margin: 0 !important; justify-content: flex-start !important; display: flex; }
    .rating-line .stars .star { font-size: 13px !important; }

    .srv-info-bottom {
        display: flex; flex-direction: column; align-items: flex-start !important; margin-top: 2px;
    }
    .srv-desc-extra {
        display: block !important; font-size: 11px !important; color: #aaa; white-space: nowrap;
    }

    /* C) BADGE (Uprostřed) */
    .srv-badge-container {
        display: flex !important;
        justify-content: center;
        align-items: center;
    }
    .quality-badge-mobile-center {
        width: 28px;
        height: 28px;
        object-fit: contain;
        display: block;
        /* Volitelné: neon efekt */
        filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.5));
    }

    /* D) VOTY (Vpravo) */
    .vote-wrap-mobile {
        display: flex !important;
        flex-direction: column;
        gap: 6px;
        align-items: flex-end;
    }

    .vote-logo-btn.mobile-btn {
      min-width: 55px; /* Na mobilu stačí méně místa */
      padding: 6px 4px;
      font-size: 12px;
  }

    .vote-wrap-desktop { display: none !important; }
}


/* --- 2. PC ZOBRAZENÍ (> 769px) --- */
@media (min-width: 769px) {
    /* PC: Flexbox pod sebou */
    .card.srv-card {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 24px !important;
        position: relative; /* Pro pozicování badge */
    }

    .srv-card .srv-logo {
        width: 96px !important;
        height: 96px !important;
        margin: 0 0 12px 0 !important;
    }

    /* Info na střed */
    .srv-info-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100%;
    }
    .srv-name-wrap { justify-content: center !important; margin-bottom: 4px; }
    .rating-line { justify-content: center !important; }
    .srv-desc-extra { display: block; font-size: 13px !important; margin-top: 4px; }

    /* BADGE NA PC - Dáme ho absolutně k názvu nebo ho skryjeme,
       protože jsme ho vyndali z name-wrapu.
       Nejlepší řešení pro PC s tímto JS: Dát ho vedle názvu absolutně */
    .srv-badge-container {
        position: absolute;
        top: 24px;
        right: 24px;
        /* Nebo ho skrýt: display: none; */
    }
    .quality-badge-mobile-center {
        width: 32px; height: 32px; /* Větší na PC */
    }

    /* Voty */
    .vote-wrap-desktop {
        display: flex !important;
        gap: 8px;
        margin-top: 10px;
        justify-content: center !important;
    }
    .vote-wrap-mobile { display: none !important; }
}

/* --- MOBILNÍ MENU (DROPDOWN) --- */

/* 1. Defaultně skryjeme tlačítko na PC */
.mobile-menu-btn {
  display: none;
}

/* 2. Styly pro mobily (< 900px) */
@media (max-width: 900px) {
  
  /* --- TLAČÍTKO HAMBURGER --- */
  .mobile-menu-btn {
      display: inline-flex !important;
      align-items: center;
      justify-content: center;
      
      /* Styl stejný jako neaktivní tab */
      height: auto; 
      padding: 10px 16px; 
      background: rgba(255,255,255,0.03); 
      border: 1px solid transparent;
      border-radius: 12px;
      color: #ccc;
      
      cursor: pointer;
      flex-shrink: 0;
      
      /* ZRUŠENO margin-left: auto, aby to neutíkalo doprava */
      margin-left: 8px; 
      
      transition: all 0.2s ease;
  }
  
  .mobile-menu-btn:hover {
      background: rgba(255, 255, 255, 0.1);
      color: white;
  }

  .mobile-menu-btn.active {
      background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%) !important;
      color: white !important;
      box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  }

  /* --- NAVIGACE NA STŘED --- */
  nav.tabs.main-tabs {
      display: flex;
      align-items: center;
      gap: 8px;
      width: 100%;
      overflow-x: auto;
      padding-bottom: 4px;
      
      /* TOTO JE TA KLÍČOVÁ ZMĚNA PRO STŘED */
      justify-content: center !important; 
  }

  /* Skryté menu (kontejner) */
  #mobileMenuContent {
      display: none;
      width: 100%;
      margin-top: 15px;
      order: 99;
  }

  #mobileMenuContent.active {
      display: block;
      animation: slideDown 0.3s ease-out;
  }

  /* Vnitřek menu (pozadí) */
  .hdr-right-glass {
      display: flex;
      flex-direction: column;
      padding: 15px;
      background: rgba(15, 18, 28, 0.95);
      border-radius: 16px;
      border: 1px solid rgba(255,255,255,0.08);
      box-shadow: 0 10px 40px rgba(0,0,0,0.5);
      align-items: center; /* Položky menu taky na střed */
  }
  
  .tabs-secondary {
      display: flex;
      flex-direction: column;
      width: 100%;
      gap: 8px;
      margin-bottom: 15px;
      align-items: center; /* Tlačítka na střed */
  }
  
  /* Neaktivní tlačítko v menu */
  .tabs-secondary .tab {
      width: 100%;
      text-align: center;
      justify-content: center;
      background: rgba(255,255,255,0.05);
      color: #ccc;
      padding: 12px;
      border-radius: 10px;
  }

  /* Aktivní tlačítko v menu */
  .tabs-secondary .tab.active {
      background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%) !important;
      color: white !important;
      box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
      border: none;
  }
  
  /* Header actions (Přihlásit) na střed */
  .header-actions {
      width: 100%;
      justify-content: center;
  }
}

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


/* --- FILTRAČNÍ LIŠTA (Desktop & Mobil) --- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-title {
  font-size: 20px;
  flex-shrink: 0;
}

.filter-inputs {
  display: flex;
  gap: 10px;
  flex-grow: 1;
  justify-content: flex-end; /* Na PC zarovnat doprava */
}

.search-input { max-width: 250px; }
.sort-select { max-width: 140px; }
.filter-dropdown { max-width: 200px; }

/* --- MOBILNÍ ÚPRAVA FILTRŮ (< 768px) --- */
@media (max-width: 768px) {
  .filter-bar {
      flex-direction: column;
      align-items: flex-start;
      gap: 8px;
      margin-bottom: 12px;
  }

  .filter-title { display: none; /* Na mobilu skryjeme nadpis "Admini/Servery" pro úsporu místa */ }

  .filter-inputs {
      width: 100%;
      display: grid;
      gap: 8px;
  }

  /* A) VARIANTA PRO SERVERY (2 prvky: Hledat | Řadit) */
  /* Pokud NENÍ přítomen dropdown se servery */
  .filter-inputs:not(:has(.filter-dropdown)) {
      grid-template-columns: 1fr 130px; /* Search široký | Sort úzký */
  }

  /* B) VARIANTA PRO ADMINY (3 prvky: Hledat | Servery | Řadit) */
  /* Pokud JE přítomen dropdown se servery */
  .filter-inputs:has(.filter-dropdown) {
      grid-template-columns: 1fr 1fr; /* Dva sloupce */
  }
  
  /* Search input u adminů roztáhneme přes celou šířku nahoru */
  .filter-inputs:has(.filter-dropdown) .search-input {
      grid-column: 1 / -1; /* Přes oba sloupce */
      max-width: 100% !important;
  }

  /* Reset šířek pro mobil */
  .search-input, 
  .sort-select, 
  .filter-dropdown,
  .dropdown-btn {
      width: 100% !important;
      max-width: none !important;
  }
  
  /* Sjednocení výšky */
  .input, .dropdown-btn {
      height: 42px; /* Trochu menší na mobil */
      font-size: 13px;
  }
}