/* ==========================================================================
   KINGDOMS — Minecraft Server
   Design tokens: dusk-stone background, aged gold accent, parchment text.
   Type: Cinzel (display / regal), Manrope (body), JetBrains Mono (data/IP).
   ========================================================================== */

@view-transition {
  navigation: auto;
}

:root {
  /* -- Color -- */
  --bg: #0d0b10;
  --bg-alt: #121016;
  --surface: #18151f;
  --surface-2: #1e1a26;
  --line: rgba(232, 179, 76, 0.12);
  --line-strong: rgba(232, 179, 76, 0.28);

  --gold: #d4a03d;
  --gold-bright: #f2c97d;
  --gold-dim: #7a5c20;

  --text: #e6dfd1;
  --text-muted: #9a92a0;
  --text-faint: #5d5665;

  --danger: #c9634a;
  --ok: #8fae5e;

  /* -- Type -- */
  --font-display: "Cinzel", "Georgia", serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", monospace;

  /* -- Layout -- */
  --maxw: 1100px;
  --radius: 12px;
  --radius-sm: 8px;

  /* -- Motion -- */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --fast: 160ms;
  --med: 340ms;
}

/* ==========================================================================
   Custom Scrollbar
   ========================================================================== */

::-webkit-scrollbar {
  width: 10px !important;
  background-color: var(--bg) !important;
}

::-webkit-scrollbar-thumb {
  background-color: var(--surface-2) !important;
  border: 2px solid var(--bg) !important;
  border-radius: 10px !important;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--gold-dim) !important;
}

html {
  scrollbar-width: thin;
  scrollbar-color: var(--surface-2) var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  background-color: var(--bg);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(1000px 600px at 50% -5%, rgba(212, 160, 61, 0.04), transparent 70%);
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

h1, h2, h3, h4 { margin: 0; color: var(--text); font-weight: 700; }
a { color: inherit; text-decoration: none; transition: 0.2s; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img, svg { display: block; max-width: 100%; }

/* ==========================================================================
   Buttons (Unifikacja wysokości)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
  font-weight: 700;
  font-size: 15px;
  border-radius: var(--radius-sm);
  transition: all var(--fast) var(--ease);
  text-align: center;
  gap: 10px;
  height: 48px; /* Stała wysokość */
}

.btn-primary { background: var(--gold); color: #120e05; border: 1px solid var(--gold); }
.btn-primary:hover { background: var(--gold-bright); transform: translateY(-2px); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--gold); }

.btn-sm { height: 40px; padding: 0 20px; font-size: 13px; }

/* ==========================================================================
   Navbar
   ========================================================================== */

.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 10px 0; /* Minimalny padding */
  transition:
    padding 0.4s var(--ease),
    background-color 0.4s var(--ease),
    border-color 0.4s var(--ease),
    backdrop-filter 0.4s var(--ease);
  background-color: rgba(13, 11, 16, 0) !important;
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(0px);
}

.navbar.is-scrolled {
  padding: 5px 0;
  background-color: rgba(13, 11, 16, 0.96) !important;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px; /* Zwiększona wysokość bazowa dla logo */
}

.brand {
  display: flex;
  align-items: center;
  height: 100%;
  position: relative;
}

.brand-logo {
  height: 100px; /* Znacznie zwiększone logo */
  width: auto;
  transition: height 0.4s var(--ease), transform 0.4s var(--ease);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
  object-fit: contain;
  /* Pozwalamy logo lekko "wystawać" optycznie jeśli trzeba */
  transform-origin: left center;
}

.navbar.is-scrolled .brand-logo {
  height: 60px; /* Zmniejszone przy scrollu, ale nadal wyraźne */
}

.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a {
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.nav-cta { display: flex; align-items: center; gap: 12px; }

.nav-ip-btn {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--gold-bright);
  padding: 0 18px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  transition: 0.2s;
  height: 40px;
  display: flex;
  align-items: center;
}
.nav-ip-btn:hover { background: var(--gold); color: #000; border-color: var(--gold); }

/* ==========================================================================
   Sections
   ========================================================================== */

section.section { padding: 100px 0; }
.section-head { max-width: 700px; margin: 0 auto 60px; text-align: center; }
.section-head h2 { font-size: clamp(30px, 5vw, 40px); margin-bottom: 20px; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero { padding: 220px 0 120px; text-align: center; } /* Zwiększony górny padding przez większy navbar */
.hero h1 { font-family: var(--font-display); font-size: clamp(42px, 8vw, 76px); line-height: 1.1; margin-bottom: 24px; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero-sub { font-size: clamp(17px, 2vw, 20px); color: var(--text-muted); max-width: 650px; margin: 0 auto 48px; }

.hero-actions { display: flex; justify-content: center; gap: 16px; align-items: center; flex-wrap: wrap; }

.ip-box {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  min-width: 320px;
  overflow: hidden;
  height: 48px; /* Tyle co .btn */
}

.ip-value {
  flex: 1;
  padding: 0 24px;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-bright);
}

.ip-box button {
  background: var(--surface-2);
  height: 100%;
  padding: 0 28px;
  font-weight: 800;
  font-size: 14px;
  border-left: 1px solid var(--line-strong);
  transition: 0.2s;
}
.ip-box button:hover { background: var(--gold); color: #000; }

/* ==========================================================================
   Stats (FORCED CENTERING)
   ========================================================================== */

.stats { padding: 80px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats-grid { display: flex; justify-content: center; gap: clamp(30px, 8vw, 100px); flex-wrap: wrap; text-align: center; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num { font-family: var(--font-display); font-size: 42px; color: var(--gold); line-height: 1; margin-bottom: 8px; }
.stat-label { font-size: 14px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }

/* ==========================================================================
   Features
   ========================================================================== */

.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 48px 32px;
  border-radius: var(--radius);
  text-align: center;
}
.feature-icon { width: 40px; height: 40px; color: var(--gold); margin: 0 auto 24px; }

/* ==========================================================================
   CTA Banner
   ========================================================================== */

.cta-banner { text-align: center; max-width: 800px; margin: 0 auto; }
.cta-actions { display: flex; justify-content: center; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ==========================================================================
   Regulamin / Rules
   ========================================================================== */

.rules-header { padding: 180px 0 60px; background: var(--bg-alt); border-bottom: 1px solid var(--line); text-align: center; }
.rules-header h1 { font-family: var(--font-display); font-size: clamp(32px, 5vw, 48px); margin-bottom: 16px; }
.rules-header p { color: var(--text-muted); max-width: 600px; margin: 0 auto; font-size: 18px; }

.rules-layout { display: grid; grid-template-columns: 280px 1fr; gap: 80px; padding-top: 60px; padding-bottom: 100px; align-items: start; }

.rules-toc {
  position: sticky; top: 120px; display: flex; flex-direction: column; gap: 2px;
  background: transparent; padding: 0; border: none;
}
.rules-toc span {
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.15em; font-size: 11px;
  color: var(--gold); margin-bottom: 16px; padding-left: 14px; opacity: 0.8;
}
.rules-toc a {
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px;
  font-weight: 600; color: var(--text-muted); border-left: 2px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s var(--ease);
}
.rules-toc a:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); border-left-color: rgba(255, 255, 255, 0.1); }
.rules-toc a.is-active {
  color: var(--gold); background: transparent; border-left-color: var(--gold);
  padding-left: 20px; /* Delikatne wysunięcie aktywnego elementu */
}

.rules-body section { margin-bottom: 80px; scroll-margin-top: 140px; }
.rules-body h2 { font-family: var(--font-display); font-size: 28px; margin-bottom: 32px; display: flex; align-items: center; gap: 16px; }
.rules-body h2 .idx { color: var(--gold); opacity: 0.4; font-size: 0.8em; }

.rules-body ol { padding: 0; list-style: none; counter-reset: rules; }
.rules-body li {
  position: relative; padding-left: 45px; margin-bottom: 20px; color: var(--text-muted); font-size: 15px; line-height: 1.8;
}
.rules-body li::before {
  counter-increment: rules; content: counter(rules) ".";
  position: absolute; left: 0; color: var(--gold); font-weight: 800; font-family: var(--font-mono); font-size: 0.9em;
}
.rules-body li strong { color: var(--text); }

.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 800; text-transform: uppercase; margin-left: 8px; vertical-align: middle; }
.tag-ban { background: rgba(201, 99, 74, 0.15); color: var(--danger); border: 1px solid rgba(201, 99, 74, 0.3); }
.tag-mute { background: rgba(232, 179, 76, 0.1); color: var(--gold); border: 1px solid rgba(232, 179, 76, 0.3); }

.rules-note { margin-top: 80px; padding: 32px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line-strong); text-align: center; color: var(--text-muted); font-style: italic; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer { padding: 1px 0; background: var(--bg); border-top: 1px solid var(--line); text-align: center; }
.footer-bottom { color: var(--text-faint); font-size: 14px; line-height: 1.2; }

/* ==========================================================================
   Animations
   ========================================================================== */

.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@keyframes success-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
.copy-success-anim { animation: success-pop 0.4s var(--ease) both; }

/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 900px) {
  .nav-links {
    position: fixed; top: 0; right: 0; bottom: 0; width: 280px;
    background: var(--surface); flex-direction: column; padding: 100px 30px;
    transform: translateX(100%); transition: 0.3s;
  }
  body.menu-open .nav-links { transform: translateX(0); }
  .features-grid { grid-template-columns: 1fr; }
  .nav-cta { display: none; }
  .rules-layout { grid-template-columns: 1fr; }
  .rules-toc { display: none; }
}

@media (max-width: 600px) {
  .hero { padding: 150px 0 80px; }
  .stats-grid { flex-direction: column; gap: 40px; }
  .ip-box { flex-direction: column; min-width: auto; width: 100%; height: auto; }
  .ip-box button { border-left: none; border-top: 1px solid var(--line-strong); width: 100%; height: 48px; }
}
