/* =========================================================
   layout.css: układ strony.
   Górny pasek, wyśrodkowana treść, stopka w kolumnach.
   Ładowany po theme.css, więc przy równej specyficzności wygrywa.
   ========================================================= */

/* ---------- Szkielet: przewija się cała strona, nie sam <main> ---------- */
html, body {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main {
  flex: 1 0 auto;
  width: 100%;
  overflow: visible;
  padding: clamp(32px, 6vw, 64px) clamp(16px, 4vw, 40px) clamp(48px, 8vw, 88px);
}

/* ---------- Górny pasek ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 2000;
  background: rgba(12, 11, 12, 0.94);
  border-bottom: 1px solid var(--glass-border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  width: min(1240px, 100%);
  height: 60px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--bone);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  flex: 0 0 auto;
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--glass-border);
  object-fit: cover;
}
.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
}
.topnav a {
  position: relative;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 0.15s ease;
}
.topnav a:hover { color: var(--bone); }
.topnav a.active { color: var(--bone); }
.topnav a.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -13px;
  height: 2px;
  background: var(--blood);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.topbar-link {
  padding: 8px 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}
.topbar-link:hover { color: var(--bone); }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 200px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--bone);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}
.user-chip:hover { border-color: #4a4041; }
.user-chip img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-compact { padding: 8px 14px; font-size: 0.9rem; gap: 8px; border-radius: 9px; }

/* ---------- Przyciski pomocnicze ---------- */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--bone);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
  transition: border-color 0.15s ease;
}
.btn-ghost:hover { border-color: var(--text-muted); }

/* ---------- Hero: tekst po lewej, karta serwera po prawej ---------- */
.hero {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto clamp(40px, 6vw, 64px);
  padding: 0;
  text-align: left;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
}
.hero-content { justify-items: start; gap: 14px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.04; }
.hero p.description { margin: 0; max-width: 46ch; font-size: 1.04rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

.server-card {
  padding: 22px;
  background: var(--bg-main);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
}
.server-card-head { display: flex; align-items: center; gap: 14px; }
.server-card-head img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  object-fit: cover;
}
.server-card-head strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.server-card-status { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 0.86rem; }
.stat-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}
.server-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 20px 0 0;
  background: var(--glass-border);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  overflow: hidden;
}
.server-stats div { padding: 12px 14px; background: var(--bg-raised); }
.server-stats dt { color: var(--text-muted); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.02em; }
.server-stats dd { margin: 4px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; }

/* ---------- Sekcje na stronie głównej ---------- */
.features-wrap { width: 100%; max-width: 1120px; margin: 0 auto; }
.features { max-width: none; }
.partners-section,
.skullboy-partners { max-width: 1120px; }

/* ---------- Strony z treścią ---------- */
.ticket-system-container,
.legal-page,
main .top,
.chat { width: 100%; max-width: 920px; margin-left: auto; margin-right: auto; }
.hero-small { max-width: 920px; margin: 0 auto 28px; }
.top-nav-info { text-align: left; }

/* ---------- Stopka ---------- */
.site-footer {
  flex: 0 0 auto;
  display: block;
  width: 100%;
  padding: 0;
  overflow: visible;
  background: var(--bg-sidebar);
  border-left: 0;
  border-top: 1px solid var(--glass-border);
}
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
  gap: 32px;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 40px clamp(16px, 4vw, 40px) 28px;
}
.footer-brand p { margin: 12px 0 0; max-width: 38ch; color: var(--text-muted); font-size: 0.9rem; line-height: 1.55; }
.footer-brand .footer-status { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 0.84rem; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 {
  margin: 0 0 4px;
  color: var(--bone);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
}
.footer-col a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; }
.footer-col a:hover { color: var(--bone); }
.footer-bottom {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 16px clamp(16px, 4vw, 40px) 24px;
  border-top: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ---------- Responsywność ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .server-card { max-width: 480px; }
  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .topbar-inner { height: 56px; gap: 12px; }
  .topbar .brand span { display: none; }
  .topnav a { padding: 8px 10px; font-size: 0.88rem; }
  .topnav a.active::after { left: 10px; right: 10px; bottom: -11px; }
  .user-chip span { display: none; }
  .user-chip { padding: 3px; }
  .topbar-link { padding: 8px 6px; }
  .hero-actions .btn-primary,
  .hero-actions .btn-ghost { flex: 1 1 100%; }
  .server-stats dd { font-size: 1.05rem; }
  .server-stats div { padding: 10px; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 32px; }
}

/* ---------- Telefon: pasek mieści się w 375 px ---------- */
@media (max-width: 520px) {
  .btn-compact .btn-label { display: none; }
  .btn-compact { padding: 9px 11px; }
  .topbar-inner { gap: 8px; }
  .topnav { gap: 0; }
  .topnav a { padding: 8px 8px; }
  .topnav a.active::after { left: 8px; right: 8px; }
}

/* Pastylki funkcji na telefonie i przycisk rozwijania: ten sam cichy styl co reszta */
.feature-mini-tile {
  background: var(--bg-raised);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--accent);
}
.feature-mini-tile em { color: var(--bone); font-weight: 600; letter-spacing: 0; }
.features-toggle-btn {
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--bone);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Dekoracyjny "#" przed nagłówkiem strony nic nie niesie */
.icon-neon { display: none; }

/* Tablet: karty funkcji od razu widoczne w dwóch kolumnach; zwijanie zostaje tylko na wąskim telefonie */
@media (min-width: 561px) and (max-width: 768px) {
  .features-mobile-strip,
  .features-toggle-btn { display: none; }
  .features-wrap .features {
    max-height: none;
    overflow: visible;
    opacity: 1;
    padding-top: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
