
:root {
  --bg-dark: #161619;
  --bg-medium: #1d1d20;
  --bg-light: #2a2a2e;
  --border-color: #38383f;
  --text-primary: #e4e4e7;
  --text-secondary: #a0a0a9;
  --accent-primary: #602d9a;
  --accent-secondary: #542787;
  --purple: #542787;
  --purple-light: #602d9a;
  --light-gray: #a8a8a8;
  --font-body: 'Poppins', sans-serif;
  --font-heading: 'Lexend Deca', sans-serif;
  --font-headings: 'Geologica', sans-serif;
  --transition-speed: 0.4s;
}

* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}

html { 
  scroll-behavior: smooth; 
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;

  /* Zabezpieczenie przed kopiowaniem */
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* --- EKRAN ŁADOWANIA --- */
.loading {
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
    visibility: visible;
}

.loading.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-logo {
    width: 120px;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
}

.loading-text-wrapper {
    margin-top: 25px;
    font-family: var(--font-headings);
    font-size: 1.1rem;
    letter-spacing: 4px;
    color: var(--light-gray);
    text-align: center;
    min-height: 2em;
    text-transform: uppercase;
}

#loading-message {
    display: inline-block;
    opacity: 1;
}

#loading-message::after {
    content: '_';
    animation: blink-cursor 0.7s infinite;
    margin-left: 2px;
    color: var(--purple-light);
}

@keyframes blink-cursor {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* TŁO (obraz) */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: #0b0c10 url('/assets/bg.jpg?v=1791637038') center / cover no-repeat;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(22, 22, 25, 0.6) 0%, rgba(22, 22, 25, 0.95) 100%);
}

/* NAWIGACJA */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 5%;
    display: flex;
    align-items: center;
    gap: 24px;
    z-index: 1000;
    transition: all var(--transition-speed) ease-in-out;
    background: transparent;
    box-shadow: none;
}

.navbar.scrolled {
    background: rgba(13, 13, 15, 0.8);
    backdrop-filter: blur(10px);
    padding: 0.85rem 5%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-menu {
    display: flex;
    flex: 1;
    gap: 2rem;
    align-items: center;
    justify-content: center;
}

.nav-link {
    color: #e7e7e7;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    transition: all 0.3s ease;
    padding: 10px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border-radius: 999px;
    letter-spacing: 0.3px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-link:hover, .nav-link.active {
    color: white;
    transform: translateY(-3px);
    border-color: var(--accent-primary);
    box-shadow: none;
    background: linear-gradient(135deg, rgba(84, 39, 135, 0.15), rgba(84, 39, 135, 0.08));
}


.nav-toggle { 
    display: none; 
    font-size: 1.5rem; 
    cursor: pointer;
    color: white;
}

/* LICZNIKI GRACZY */
.status-left,
.status-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.status-right { margin-left: auto; }

.player-count-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    min-width: 140px;
    height: 56px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.22s ease;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
    text-decoration: none;
    position: relative;
    cursor: pointer;
    flex-wrap: nowrap;
}

.player-count-container:hover {
    transform: translateY(-3px);
    box-shadow: none;
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(84, 39, 135, 0.15), rgba(84, 39, 135, 0.08));
}

.player-count-container[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 10;
}

.player-count-icon {
    font-size: 1.05rem;
    color: var(--purple-light);
    text-shadow: none;
}

.live-indicator {
    width: 8px;
    height: 8px;
    background-color: #2ecc71;
    border-radius: 50%;
    animation: livePulse 2s ease-in-out infinite;
    transition: background-color 0.5s;
}

@keyframes livePulse {
    0% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.25); opacity: 1; }
    100% { transform: scale(1); opacity: 0.85; }
}

.player-count-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    line-height: 1.1;
    gap: 2px;
}

#player-count-label, #player-count-label-soon {
    font-size: 0.68rem;
    color: #dcdcdc;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.player-count-numbers {
    display: flex;
    align-items: center;
    gap: 2px;
    font-weight: 700;
    color: white;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.count-separator { margin: 0 1px; }

#player-count {
    font-size: 1.32rem;
    line-height: 1;
}

.count-separator, #max-players {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--light-gray);
    line-height: 1;
}

.trend-arrow {
    font-size: 1rem;
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.5s, transform 0.5s;
    transform: translateY(5px);
}

.trend-arrow.visible { opacity: 1; transform: translateY(0); }
.trend-arrow.up { color: #2ecc71; text-shadow: 0 0 8px #2ecc71; }
.trend-arrow.down { color: #e74c3c; text-shadow: 0 0 8px #e74c3c; }

/* Status SOON */
.player-count-container.soon-status .live-indicator {
    background-color: #e74c3c;
    animation: soonDot 1.6s ease-in-out infinite;
}

.player-count-container.soon-status #player-count-label-soon {
    color: #e74c3c;
}

.player-count-container.soon-status {
    cursor: default;
    flex: 0 0 auto;
    min-width: 140px;
}

.player-count-container.soon-status .player-count-icon {
    color: var(--light-gray);
}

.player-count-container.soon-status:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.player-count-container.soon-status .player-count-numbers span {
    font-size: 1.2rem;
    letter-spacing: 1px;
}

@keyframes soonDot {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

/* PRZYCISK ADMINA */
.admin-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    background: rgba(29, 29, 32, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-size: 1.2rem;
    text-decoration: none;
}

.admin-button:hover {
    transform: scale(1.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: none;
}

/* RESPONSIVE NAV */
@media (max-width: 992px) {
    .nav-toggle { display: block; z-index: 1001; }
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: rgba(20, 20, 20, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.5s ease-in-out;
        z-index: 1000;
    }
    .nav-menu.active { right: 0; }
    .player-count-container { display: none; }
    .status-left, .status-right { display: none; }
}


/* --- Reszta stylów bez zmian --- */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-medium); }
::-webkit-scrollbar-thumb { background: var(--accent-secondary); border-radius: 10px; }

#rules-page {
    position: relative;
    z-index: 1;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 80px; /* Przestrzeń na navbar */
}

.rules-landing { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: calc(100vh - 80px); padding: 5vw 2vw; text-align: center; position: relative; }

.landing-copyright {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.7;
    letter-spacing: 0.5px;
}
.rules-hero-text { margin-bottom: 4vw; }
.rules-hero-text h1 { font-family: var(--font-heading); font-size: clamp(1.4rem, 3.2vw, 3rem); margin-bottom: 1rem; text-shadow: 0 0 20px rgba(0, 0, 0, 0.5); min-height: 1.2em; display: flex; justify-content: center; align-items: center; gap: 5px; white-space: nowrap; }
.rules-hero-text p { font-size: clamp(0.9rem, 1.1vw, 1.2rem); color: var(--text-primary); }

.rules-hero-text .cursor {
    color: var(--accent-primary);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* === KAFELKI KATEGORII (STYL JAK W PODANIACH) === */
.category-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  width: 100%;
  max-width: 1400px;
}

.rule-category-card {
  background: rgba(29, 29, 32, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(56, 56, 63, 0.9);
  border-radius: 15px;
  padding: 24px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
  min-height: 210px;
}

.rule-category-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255,255,255,0.08), transparent 25%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.rule-category-card:hover {
  transform: translateY(-10px);
  border-color: rgba(96, 45, 154, 0.9);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.rule-category-card:hover::after {
  opacity: 1;
}

.card-shine {
  display: none;
}

/* Ikona kategorii */
.rule-category-card .category-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  transition: all 0.2s ease;
  position: relative;
}

.rule-category-card:hover .category-icon {
  transform: translateY(-2px);
}

/* Domyślny styl ikony (fioletowy) */
.rule-category-card .category-icon {
  background: rgba(123, 57, 198, 0.14);
  border: 1px solid rgba(123, 57, 198, 0.22);
  box-shadow: none;
}

.rule-category-card .category-icon i {
  font-size: 2.1rem;
  color: #7b39c6;
}

/* Różne kolory dla różnych kategorii */
.rule-category-card.blue-card .category-icon {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.22);
  box-shadow: none;
}

.rule-category-card.blue-card .category-icon i {
  color: #3b82f6;
}

.rule-category-card.yellow-card .category-icon {
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.22);
  box-shadow: none;
}

.rule-category-card.yellow-card .category-icon i {
  color: #fbbf24;
}

.rule-category-card.red-card .category-icon {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.22);
  box-shadow: none;
}

.rule-category-card.red-card .category-icon i {
  color: #ef4444;
}

.rule-category-card.green-card .category-icon {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.22);
  box-shadow: none;
}

.rule-category-card.green-card .category-icon i {
  color: #10b981;
}

/* Fallback dla starych ikon bez .category-icon wrapper */
.rule-category-card > i {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 2.1rem;
  color: #7b39c6;
  background: rgba(123, 57, 198, 0.14);
  border: 1px solid rgba(123, 57, 198, 0.22);
  box-shadow: none;
  transition: all 0.2s ease;
}

.rule-category-card:hover > i {
  transform: translateY(-2px);
}

/* Tytuł kategorii */
.rule-category-card h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: white;
  margin: 0 0 10px 0;
  transition: color 0.3s ease;
  border: none;
  padding: 0;
  text-align: center;
}

.rule-category-card:hover h2 {
  color: var(--accent-primary);
}

/* Opis kategorii */
.rule-category-card p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  line-height: 1.6;
  text-align: center;
}

.rules-detailed-view { display: grid; grid-template-columns: 280px 1fr; grid-template-rows: 60px 1fr; height: 100vh; position: fixed; top: 0; left: 0; width: 100%; background: rgba(22, 22, 25, 0.95); backdrop-filter: blur(20px); z-index: 500; }
.home-link-gitbook { grid-column: 1 / 2; grid-row: 1 / 2; display: flex; align-items: center; padding: 0 20px; background: rgba(22, 22, 25, 0.8); border-bottom: 1px solid var(--border-color); border-right: 1px solid var(--border-color); text-decoration: none; color: var(--text-primary); font-family: var(--font-heading); font-size: 1.1rem; gap: 10px; transition: color 0.2s; }
.home-link-gitbook:hover { color: var(--accent-primary); }
.home-link-gitbook img { height: 30px; }

.rules-sidebar { grid-column: 1 / 2; grid-row: 2 / 3; background: transparent; border-right: 1px solid var(--border-color); display: flex; flex-direction: column; overflow: hidden; }
.sidebar-header { padding: 15px; border-bottom: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 10px; }
.sidebar-header input { width: 100%; padding: 10px; background: var(--bg-dark); border: 1px solid var(--border-color); border-radius: 5px; color: var(--text-primary); font-size: 0.9rem; }
.sidebar-header input:focus { border-color: var(--accent-primary); outline: none; }
.back-to-landing-sidebar { background: var(--bg-light); border: 1px solid var(--border-color); color: var(--text-primary); padding: 10px; border-radius: 5px; width: 100%; cursor: pointer; font-size: 0.9rem; text-align: center; transition: all 0.2s ease; }
.back-to-landing-sidebar:hover { background: var(--bg-dark); border-color: var(--accent-primary); color: var(--accent-primary); }
.back-to-landing-sidebar i { margin-right: 8px; }

.sidebar-nav { padding: 15px; overflow-y: auto; flex-grow: 1; }
.sidebar-nav a { display: block; text-decoration: none; padding: 8px 12px; margin-bottom: 4px; border-radius: 5px; font-size: 0.9rem; color: var(--text-secondary); transition: all 0.2s ease; border-left: 3px solid transparent; }
.sidebar-nav a:hover { color: var(--text-primary); background: var(--bg-light); }
.sidebar-nav a.active { color: var(--accent-primary); background: rgba(96, 45, 154, 0.1); border-left-color: var(--accent-primary); font-weight: 500; }
.sidebar-nav a.nav-sub { padding-left: 28px; font-size: 0.85rem; }

.rules-main-content { grid-column: 2 / 3; grid-row: 1 / 3; display: flex; flex-direction: column; overflow: hidden; }
.content-header { height: 60px; display: flex; align-items: center; padding: 0 24px; border-bottom: 1px solid var(--border-color); background: transparent; }
.mobile-sidebar-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.2rem; cursor: pointer; }
.content-scroll-area { overflow-y: auto; padding: 2.5rem 4rem; flex-grow: 1; }

section { scroll-margin-top: 20px; transition: background-color 0.5s ease; border-radius: 8px; }
hr { border: none; height: 1px; background-color: var(--border-color); margin: 3rem 0; }
h2 { font-family: var(--font-heading); font-size: 2rem; color: var(--text-primary); padding-bottom: 0.8rem; border-bottom: 1px solid var(--border-color); margin-bottom: 1.5rem; scroll-margin-top: 80px; }
h3 { font-family: var(--font-heading); font-size: 1.5rem; color: var(--text-primary); margin: 2.5rem 0 1.2rem 0; scroll-margin-top: 80px; }
.rule { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 0.8rem; line-height: 1.7; }
.rule span { font-weight: 500; color: var(--text-secondary); min-width: 40px; text-align: right; }
.rule p { margin: 0; color: var(--text-primary); }

.hint-block { padding: 1rem 1.5rem; margin: 1.5rem 0; border-radius: 8px; border-left: 4px solid; display: flex; align-items: flex-start; gap: 1rem; background: rgba(255, 255, 255, 0.05); }
.hint-block.info { border-color: #3B82F6; }
.hint-block i { color: #3B82F6; margin-top: 4px; }
.hint-block p { margin: 0; color: var(--text-primary); font-size: 0.9rem; line-height: 1.6; }

.content-footer { margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--border-color); }
.footer-nav { display: flex; justify-content: space-between; margin-bottom: 2rem; }
.footer-nav a { text-decoration: none; color: var(--text-secondary); background: var(--bg-light); border: 1px solid var(--border-color); padding: 0.8rem 1.2rem; border-radius: 8px; transition: all 0.2s ease; }
.footer-nav a:hover { color: var(--accent-primary); border-color: var(--accent-primary); }
.footer-content { display: flex; justify-content: space-between; align-items: center; }
.last-updated, .copyright-text { text-align: center; color: var(--text-secondary); font-size: 0.8rem; }


@keyframes highlight-fade {
  0% { background-color: rgba(96, 45, 154, 0.15); }
  100% { background-color: rgba(96, 45, 154, 0); }
}
section.highlight-animation { animation: highlight-fade 2s ease-out forwards; }

@media (max-width: 1024px) {
    .rules-detailed-view { grid-template-columns: 1fr; grid-template-rows: 60px 1fr; }
    .home-link-gitbook { display: none; }
    .rules-sidebar { position: fixed; top: 0; left: -100%; width: 300px; height: 100%; z-index: 2000; transition: left 0.3s ease; box-shadow: 5px 0 15px rgba(0,0,0,0.2); background: rgba(22, 22, 25, 0.95); backdrop-filter: blur(20px); }
    .rules-sidebar.open { left: 0; }
    .rules-main-content { grid-column: 1 / -1; }
    .mobile-sidebar-toggle { display: block; }
    .content-scroll-area { padding: 2rem; }
}
@media (max-width: 768px) {
    .category-cards-container { 
      grid-template-columns: 1fr; 
      gap: 20px;
    }
    
    .rule-category-card {
      padding: 40px 25px;
    }
    
    .rule-category-card .category-icon,
    .rule-category-card > i {
      width: 80px;
      height: 80px;
      margin-bottom: 20px;
    }
    
    .rule-category-card .category-icon i,
    .rule-category-card > i {
      font-size: 2.5rem;
    }
    
    .rule-category-card h2 {
      font-size: 1.5rem;
    }
    
    h2:not(.rule-category-card h2) { font-size: 1.8rem; }
    h3 { font-size: 1.3rem; }
    .footer-content { flex-direction: column; gap: 0.5rem; }
    .admin-button { width: 45px; height: 45px; }
}

/* --- POPUP KONTAKTOWY (STYL JAK W PODANIACH) --- */
.contact-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.contact-popup.active {
    opacity: 1;
    visibility: visible;
}

.contact-container {
    width: 90%;
    max-width: 550px;
    background: var(--bg-light, #1d1d20);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    transform: scale(0.95);
    transition: transform 0.4s ease;
}

.contact-popup.active .contact-container {
    transform: scale(1);
}

.contact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.contact-header h2 {
    color: white;
    font-size: 1.8rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    font-family: var(--font-heading);
}

.contact-header h2 i {
    color: var(--accent-primary);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    padding: 5px;
}

.close-btn:hover {
    color: white;
    transform: rotate(90deg);
}

.contact-intro {
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.6;
    text-align: center;
}

.contact-method {
    display: flex;
    gap: 20px;
    align-items: center;
    background: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 10px;
}

.contact-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.contact-icon.ticket {
    background: #5865F2;
    color: white;
}

.contact-info h3 {
    color: white;
    margin: 0 0 5px 0;
    font-size: 1.2rem;
}

.contact-info p {
    color: var(--text-secondary);
    margin: 0 0 15px 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.contact-link:hover {
    transform: scale(1.05);
    background: var(--accent-secondary);
    box-shadow: none;
}

.contact-link i {
    transition: transform 0.3s ease;
}

.contact-link:hover i {
    transform: translateX(3px);
}

/* Stopka popupu */
.contact-footer {
    padding-top: 20px;
    margin-top: 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-footer p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
    opacity: 0.7;
}

@media (max-width: 600px) {
    .contact-method {
        flex-direction: column;
        text-align: center;
    }
    .contact-container {
        padding: 30px 20px;
    }
    .contact-header h2 {
        font-size: 1.5rem;
    }
}

/* Styl dla wyróżnionych ramek ostrzeżeń w regulaminie */
.rule-note {
  background: rgba(230, 57, 70, 0.1);
  border: 1px solid rgba(230, 57, 70, 0.4);
  border-left: 4px solid #e63946;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 15px 0;
  color: #ffb4b4;
  font-size: 0.95rem;
}
.rule-note i {
  color: #e63946;
  margin-right: 8px;
}
/* --- DODATKOWA RESPONSYWNOŚĆ --- */
img, video, iframe { max-width: 100%; }
.content-scroll-area table, .rules-main-content table { display: block; max-width: 100%; overflow-x: auto; }
.content-scroll-area, .rules-main-content { word-wrap: break-word; overflow-wrap: anywhere; }
.content-scroll-area img { height: auto; }
@media (max-width: 1024px) {
    .mobile-sidebar-toggle, .close-btn { min-width: 44px; min-height: 44px; }
}
@media (max-width: 480px) {
    .content-scroll-area { padding: 1rem; }
    .rule-category-card { padding: 30px 18px; }
    .footer-nav { flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
    .footer-nav a { padding: 0.7rem 1rem; min-height: 44px; }
    .contact-link { min-height: 44px; justify-content: center; }
    .contact-container { padding: 24px 16px; max-height: 92vh; overflow-y: auto; }
    .nav-menu { width: 85%; }
}

/* --- Telefon: przewijanie i stopka (dvh uwzglednia pasek adresu przegladarki) --- */
#rules-page, .content-scroll-area, .sidebar-nav {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}
.content-scroll-area { min-height: 0; }
.rules-main-content { min-height: 0; }
@supports (height: 100dvh) {
    #rules-page { height: 100dvh; }
    .rules-landing { min-height: calc(100dvh - 80px); }
    .rules-detailed-view { height: 100dvh; }
}
@media (max-width: 1024px) {
    .landing-copyright {
        position: static;
        transform: none;
        margin-top: 28px;
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
        text-align: center;
        opacity: 0.85;
    }
    .rules-landing { justify-content: flex-start; }
    .content-scroll-area { padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px)); }
}

/* ==========================================================================
   ODSWIEZONY WYGLAD REGULAMINU (karty sekcji, czytelne numery punktow, plynne animacje)
   ========================================================================== */
:root {
  --rg-accent: #8b5cf6;
  --rg-accent-soft: rgba(139, 92, 246, 0.14);
  --rg-card: #18181e;
  --rg-line: rgba(255, 255, 255, 0.07);
}

/* Widok szczegolowy: gladsze tlo, delikatne rozdzielenie paneli */
.rules-detailed-view {
  /* w pelni nieprzezroczyste tlo - nic z tla strony nie prześwieca */
  background:
    radial-gradient(ellipse 60% 40% at 70% 0%, rgba(139, 92, 246, 0.10), transparent 70%),
    #111115;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.rules-sidebar { border-right-color: var(--rg-line); background: #131318; }
.home-link-gitbook { border-bottom-color: var(--rg-line); border-right-color: var(--rg-line); }
.sidebar-header { border-bottom-color: var(--rg-line); }
.content-header { border-bottom-color: transparent; }

.sidebar-header input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--rg-line);
  border-radius: 10px;
  padding: 11px 14px;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.sidebar-header input:focus {
  border-color: var(--rg-accent);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px var(--rg-accent-soft);
}
.back-to-landing-sidebar {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--rg-line);
  border-radius: 10px;
  padding: 11px;
}
.back-to-landing-sidebar:hover {
  background: var(--rg-accent-soft);
  border-color: var(--rg-accent);
  color: #fff;
}
.back-to-landing-sidebar i { transition: transform 0.2s ease; }
.back-to-landing-sidebar:hover i { transform: translateX(-3px); }

/* Nawigacja boczna */
.sidebar-nav { padding: 14px 12px; scrollbar-width: thin; scrollbar-color: rgba(139, 92, 246, 0.5) transparent; }
.sidebar-nav a {
  border-radius: 10px;
  border-left: none;
  padding: 9px 12px;
  margin-bottom: 2px;
  line-height: 1.4;
  position: relative;
  transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}
.sidebar-nav a:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.sidebar-nav a.active {
  color: #fff;
  background: linear-gradient(90deg, var(--rg-accent-soft), rgba(139, 92, 246, 0.03));
  font-weight: 500;
}
.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  border-radius: 3px;
  background: var(--rg-accent);
}

/* Tresc: waski, czytelny kontener wysrodkowany */
.content-scroll-area {
  padding: 2.2rem clamp(1.2rem, 4vw, 4rem) 3rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.5) transparent;
}
.content-scroll-area > .rules-content-section,
.content-scroll-area > .content-footer {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

/* Kazda sekcja (paragraf) jako karta */
.rules-content-section > hr { display: none; }
.rules-content-section > section {
  background: var(--rg-card);
  border: 1px solid var(--rg-line);
  border-radius: 18px;
  padding: 26px 30px 20px;
  margin-bottom: 20px;
  scroll-margin-top: 16px;
}
.rules-content-section > section > h2 {
  position: relative;
  font-size: clamp(1.25rem, 1.6vw, 1.55rem);
  line-height: 1.3;
  font-weight: 800;
  color: #fff;
  border-bottom: none;
  padding-bottom: 0.9rem;
  margin-bottom: 1rem;
}
.rules-content-section > section > h2::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 44px; height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--rg-accent), rgba(139, 92, 246, 0));
}

/* Punkty regulaminu: numer w stalej kolumnie, plynne podswietlenie po najechaniu */
.rules-content-section .rule {
  display: flex;               /* bezpieczny domyslny uklad (takze punkty bez numeru) */
  gap: 0.4rem;
  align-items: flex-start;
  overflow-wrap: normal;       /* numer nie moze sie lamac znak po znaku */
  word-break: normal;
  padding: 7px 10px;
  margin: 0 -10px 2px;
  border-radius: 10px;
  line-height: 1.7;
  font-size: 0.97rem;
  font-weight: 600;
  color: #b9a4ee;               /* kolor numeru (tekst bez znacznika) */
  font-variant-numeric: tabular-nums;
  transition: background-color 0.2s ease;
}
.rules-content-section .rule:hover { background: rgba(255, 255, 255, 0.035); }
.rules-content-section .rule p {
  white-space: normal;
  font-weight: 400;
  color: var(--text-primary);
  min-width: 0;
}

/* Wyrozniona ramka i podpowiedzi */
.rule-note { border-radius: 12px; }
.hint-block { border-radius: 12px; }

/* Stopka */
.content-footer { border-top-color: var(--rg-line); }

/* Podswietlenie sekcji po przejsciu z menu */
@keyframes highlight-fade {
  0%   { box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.7), 0 0 28px rgba(139, 92, 246, 0.22); }
  100% { box-shadow: 0 0 0 1px rgba(139, 92, 246, 0), 0 0 0 rgba(139, 92, 246, 0); }
}

@keyframes rgRise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* Kafelki kategorii: nieco delikatniejsze */
.rule-category-card {
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border-color: var(--rg-line);
}
.rule-category-card h2 { font-size: 1.45rem; }

@media (max-width: 768px) {
  .rules-content-section > section { padding: 20px 18px 14px; border-radius: 14px; }
  .rules-content-section .rule.has-num { grid-template-columns: 3.4rem 1fr; }
  .rules-content-section .rule { font-size: 0.93rem; }
}
@media (prefers-reduced-motion: reduce) {
  .rules-content-section > section { animation: none; }
}
.rules-content-section > section.highlight-animation { animation: highlight-fade 2s ease-out forwards; }

/* Osierocony fragment tekstu (bez numeru) wyrownany do kolumny z trescia */
.rules-content-section .rule.rule-orphan { color: transparent; }
.rules-content-section .rule.rule-orphan > span { display: block; }
.rules-content-section .rule > br { display: none; }

/* Punkt z numerem (klasa has-num nadawana w app.js): stala kolumna numeru, tresc wyrownana pod soba */
.rules-content-section .rule.has-num {
  display: grid;
  grid-template-columns: 3.8rem minmax(0, 1fr);
}
.rules-content-section .rule > p {
  flex: 1 1 0;
  min-width: 0;
  overflow-wrap: break-word;
}
.rules-content-section .rule.rule-orphan > span { flex: 0 0 3.8rem; }

/* Tabele w regulaminie (tworzone w prostym edytorze panelu) */
.rules-content-section table.rules-table {
  display: block;               /* przewijanie poziome na waskich ekranach */
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin: 14px 0 18px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--rg-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}
.rules-content-section table.rules-table th,
.rules-content-section table.rules-table td {
  padding: 11px 16px;
  text-align: left;
  vertical-align: top;
  font-size: 0.93rem;
  line-height: 1.5;
  border-bottom: 1px solid var(--rg-line);
  min-width: 90px;
}
.rules-content-section table.rules-table th {
  background: var(--rg-accent-soft);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}
.rules-content-section table.rules-table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.025); }
.rules-content-section table.rules-table tbody tr:hover td { background: rgba(139, 92, 246, 0.08); }
.rules-content-section table.rules-table tr:last-child td { border-bottom: none; }

/* Podpunkty (wciete: •, a), b)...) - wezsza kolumna oznaczenia, tresc bliżej */
.rules-content-section .rule.has-num[style*="padding-left"] {
  grid-template-columns: 2.2rem minmax(0, 1fr);
}

/* ==== Hierarchia punktow (klasy nadawane w app.js) ==== */

/* Tytul dzialu (np. "15. Strefy narkotykowe") */
.rules-content-section .rule.rule-group-1 {
  margin-top: 1.7rem;
  padding: 12px 10px 12px;
  border-bottom: 1px solid var(--rg-line);
  border-radius: 10px 10px 0 0;
  color: #fff;
  font-size: 1.12rem;
  font-weight: 800;
}
.rules-content-section .rule.rule-group-1 > p {
  font-family: var(--font-heading);
  font-size: 1.12rem;
  font-weight: 800;
  color: #fff;
}
.rules-content-section .rule.rule-group-1:first-child { margin-top: 0; }

/* Podtytul (np. "15.1. Verbal Green Zone") */
.rules-content-section .rule.rule-group-2 {
  margin-top: 1.1rem;
  padding-top: 8px;
  color: #c9b6f5;
}
.rules-content-section .rule.rule-group-2 > p {
  font-weight: 700;
  color: #fff;
  font-size: 1.02rem;
}

/* Akapit bez numeru pod punktem - w kolumnie z trescia, w delikatnym kolorze */
.rules-content-section .rule.rule-aligned {
  padding-left: calc(3.8rem + 0.4rem + 10px);
}
.rules-content-section .rule.rule-aligned > p { color: var(--text-secondary); }

/* Wciete podpunkty (•, a), b)) ustawione pod trescia punktu */
.rules-content-section .rule.has-num[style*="padding-left"] {
  margin-left: calc(3.8rem + 0.4rem);
  padding-top: 3px;
  padding-bottom: 3px;
}
@media (max-width: 768px) {
  .rules-content-section .rule.rule-aligned { padding-left: calc(3.4rem + 0.4rem + 10px); }
  .rules-content-section .rule.has-num[style*="padding-left"] { margin-left: calc(3.4rem + 0.4rem); }
}

/* ==== Bloki (akapity): dzial i podtytul z punktami sa wyraznie oddzielone ==== */
.rules-content-section .rule-block {
  margin-top: 1.9rem;
}
.rules-content-section .rule-block:first-of-type { margin-top: 0.4rem; }
.rules-content-section .rule-block > .rule.rule-group-1 { margin-top: 0; margin-bottom: 0.9rem; }

.rules-content-section .rule-subblock {
  margin: 0 0 1.1rem;
  padding: 10px 14px 8px;
  background: rgba(255, 255, 255, 0.022);
  border: 1px solid var(--rg-line);
  border-left: 3px solid rgba(139, 92, 246, 0.45);
  border-radius: 14px;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.rules-content-section .rule-subblock:hover {
  border-left-color: rgba(139, 92, 246, 0.9);
  background: rgba(255, 255, 255, 0.032);
}
.rules-content-section .rule-subblock > .rule.rule-group-2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  padding-top: 4px;
}
.rules-content-section .rule-subblock > table.rules-table { margin: 10px 0 14px; }

/* Tabele: slowa nie moga byc lamane w polowie (nadpisuje overflow-wrap: anywhere z obszaru tresci) */
.rules-content-section table.rules-table,
.rules-content-section table.rules-table th,
.rules-content-section table.rules-table td {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
}
.rules-content-section table.rules-table th,
.rules-content-section table.rules-table td {
  min-width: 7.5rem;
}
.rules-content-section table.rules-table td:first-child {
  font-weight: 600;
}

/* Tabele zawsze na pelna szerokosc tla (bez pustego paska) - przewijanie poziome robi opakowanie */
.rules-content-section .rules-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  margin: 14px 0 18px;
  border: 1px solid var(--rg-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  -webkit-overflow-scrolling: touch;
}
.rules-content-section .rules-table-wrap > table.rules-table {
  display: table;
  width: 100%;
  min-width: 34rem;           /* na waskich ekranach: przewijanie zamiast sciskania */
  margin: 0;
  border: 0;
  border-radius: 0;
  border-collapse: collapse;
  background: transparent;
  overflow: visible;
}
.rules-content-section .rules-table-wrap > table.rules-table th,
.rules-content-section .rules-table-wrap > table.rules-table td {
  border-bottom: 1px solid var(--rg-line);
}
.rules-content-section .rules-table-wrap > table.rules-table tr:last-child td { border-bottom: 0; }
/* Gdy opakowanie nie zadziala (brak JS), tabela tez wypelnia szerokosc */
.rules-content-section table.rules-table { display: table; width: 100%; }
.rules-content-section .rule-subblock > .rules-table-wrap { margin: 10px 0 14px; }


/* ==== Animacje przy przewijaniu (klasy nadaje app.js) ==== */
.rg-pre {
  opacity: 0;
  transform: translate3d(0, var(--rg-y, 12px), 0);
}
.rg-pre.rg-go {
  opacity: 1;
  transform: none;
  will-change: opacity, transform;
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Pasek postepu czytania u gory widoku regulaminu */
.rg-progress {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 40;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.04);
}
.rg-progress > span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, #6d3fd0, #a78bfa);
  transition: transform 0.12s linear;
}

@media (prefers-reduced-motion: reduce) {
  .rg-pre, .rg-pre.rg-go { opacity: 1; transform: none; transition: none; }
  .rg-progress > span { transition: none; }
}

/* ==== Szersza tresc regulaminu (mniej pustego miejsca na duzych ekranach) ==== */
.content-scroll-area > .rules-content-section,
.content-scroll-area > .content-footer {
  max-width: min(1240px, 100%);
}
.content-scroll-area {
  padding-left: clamp(1.2rem, 3vw, 3rem);
  padding-right: clamp(1.2rem, 3vw, 3rem);
}
.rules-content-section > section {
  padding: 30px 38px 24px;
}
.rules-content-section .rule {
  font-size: 1.05rem;
  line-height: 1.75;
  grid-template-columns: 4.4rem minmax(0, 1fr);
}
.rules-content-section .rule.has-num { grid-template-columns: 4.4rem minmax(0, 1fr); }
.rules-content-section .rule.rule-group-1 > p { font-size: 1.25rem; }
.rules-content-section .rule.rule-group-2 > p { font-size: 1.1rem; }
.rules-content-section > section > h2 { font-size: clamp(1.4rem, 1.9vw, 1.75rem); }
.rules-content-section .rule.rule-aligned { padding-left: calc(4.4rem + 0.4rem + 10px); }
.rules-content-section .rule.has-num[style*="padding-left"] {
  margin-left: calc(4.4rem + 0.4rem);
  grid-template-columns: 2.4rem minmax(0, 1fr);
}
.rules-content-section table.rules-table th,
.rules-content-section table.rules-table td { font-size: 1rem; padding: 12px 18px; }
@media (max-width: 1024px) {
  .rules-content-section > section { padding: 22px 20px 16px; }
  .rules-content-section .rule { font-size: 1rem; }
}
@media (max-width: 768px) {
  .rules-content-section .rule.has-num,
  .rules-content-section .rule { grid-template-columns: 3.4rem minmax(0, 1fr); }
  .rules-content-section .rule.rule-aligned { padding-left: calc(3.4rem + 0.4rem + 10px); }
  .rules-content-section .rule.has-num[style*="padding-left"] { margin-left: calc(3.4rem + 0.4rem); }
}

/* Globalny pasek postepu (assets/site-scroll.js) zastepuje lokalny pasek regulaminu */
.rg-progress { display: none !important; }
