/* --- Змінні та Базові стилі --- */
:root {
  /* UDream Темна тема (Dark Red / Dark Gray / White) */
  --bg-color-dark: #121212; /* Темно-сірий, майже чорний */
  --text-color-dark: #f5f5f5; /* Білий, трохи пом'якшений для очей */
  --card-bg-dark: #1e1e1e; /* Трохи світліший сірий для карток */
  --border-color-dark: #333333; /* Сіра рамка */

  --accent-color-dark: #b71c1c; /* Темно-червоний */
  --secondary-accent-dark: #f44336; /* Яскраво-червоний для ховерів/акцентів */

  --minecraft-green-dark: #2e7d32;
  --minecraft-brown-dark: #4e342e;
  --accent-color-focus: rgba(183, 28, 28, 0.25);

  /* UDream Світла тема */
  --bg-color-light: #f5f5f5;
  --text-color-light: #121212;
  --card-bg-light: #ffffff;
  --border-color-light: #d4d4d4;

  --accent-color-light: #d32f2f; /* Яскраво-червоний */
  --secondary-accent-light: #b71c1c; /* Темно-червоний */

  --minecraft-green-light: #388e3c;
  --minecraft-brown-light: #5d4037;

  --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html[data-theme="dark"] {
  --bg-color: var(--bg-color-dark);
  --text-color: var(--text-color-dark);
  --card-bg: var(--card-bg-dark);
  --border-color: var(--border-color-dark);
  --accent-color: var(--accent-color-dark);
  --secondary-accent: var(--secondary-accent-dark);
  --minecraft-green: var(--minecraft-green-dark);
  --minecraft-brown: var(--minecraft-brown-dark);
  --link-hover-color: var(--secondary-accent-dark);
}

html[data-theme="light"] {
  --bg-color: var(--bg-color-light);
  --text-color: var(--text-color-light);
  --card-bg: var(--card-bg-light);
  --border-color: var(--border-color-light);
  --accent-color: var(--accent-color-light);
  --secondary-accent: var(--secondary-accent-light);
  --minecraft-green: var(--minecraft-green-light);
  --minecraft-brown: var(--minecraft-brown-light);
  --link-hover-color: var(--accent-color-light);
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 15px;
}

main {
  flex-grow: 1;
}

h1, h2, h3 {
  color: var(--text-color);
}
h2 {
  text-align: center;
  margin-bottom: 40px;
  font-size: 2.5em;
}

/* Збереження сумісності зі старим HTML + нові назви */
.ukraine-blue, .udream-red { color: var(--accent-color); }
.ukraine-yellow, .udream-light { color: var(--text-color); font-weight: bold; }

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}
a:hover {
  color: var(--secondary-accent);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Header --- */
header {
  background-color: var(--card-bg);
  padding: 10px 0;
  border-bottom: 2px solid var(--accent-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}
.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  z-index: 1001;
  margin-right: auto;
}
.logo {
  height: 35px;
  margin-right: 8px;
}
header h1 {
  font-size: 1.4em;
  margin: 0;
  color: var(--text-color);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- Desktop Navigation --- */
.primary-navigation ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 20px;
}
.primary-navigation ul li a {
  font-size: 1em;
  font-weight: 500;
  padding: 5px 0;
  color: var(--text-color);
  text-transform: uppercase;
  font-size: 0.9em;
  letter-spacing: 0.5px;
}
.primary-navigation ul li a:hover,
.primary-navigation ul li a.active {
  color: var(--secondary-accent);
}
.primary-navigation ul li a.active {
  border-bottom: 2px solid var(--secondary-accent);
}

.primary-navigation #theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-size: 1.3em;
  padding: 6px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
}
.primary-navigation #theme-toggle:hover {
  background-color: var(--border-color);
}
.primary-navigation #theme-toggle .theme-text {
  display: none;
}

/* --- Mobile Navigation Toggle --- */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-color);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0.5em;
  z-index: 1002;
  margin-left: 10px;
}
.mobile-nav-toggle .open-icon,
.mobile-nav-toggle .close-icon {
  transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}
.mobile-nav-toggle .close-icon {
  display: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-size: 1.3em;
  padding: 6px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-left: 15px;
}
#theme-toggle:hover {
  background-color: var(--border-color);
}

/* --- Top Players Section --- */
#top-players {
  padding: 60px 0;
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
}
#top-players h2 {
  margin-bottom: 40px;
}

.leaderboard-container {
  width: 100%;
}
.loading-placeholder,
.error-placeholder {
  text-align: center;
  font-size: 1.2em;
  padding: 40px;
  color: var(--text-color);
}
.error-placeholder {
  color: #ff6b6b;
}

.leaderboard-podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 15px;
  margin-bottom: 40px;
}

.leaderboard-player {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 20px 15px;
  text-align: center;
  width: 160px;
  border: 1px solid var(--border-color);
  position: relative;
  transition: transform 0.2s ease-in-out;
}
.leaderboard-player:hover {
  transform: translateY(-5px);
  border-color: var(--secondary-accent);
}

.player-rank-podium {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--text-color);
  color: var(--bg-color);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 1.1em;
  border: 2px solid var(--bg-color);
}

.player-letter-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 15px auto 10px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2.5rem;
  font-weight: bold;
  color: white;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  border: 2px solid var(--border-color);
}
.player-letter-avatar-list {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin: 0 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  font-weight: bold;
  color: white;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.player-name {
  font-size: 1.2em;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-balance {
  font-size: 1em;
  font-weight: 500;
  color: var(--secondary-accent);
}

.podium-crown {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.5em;
  color: var(--secondary-accent);
  filter: drop-shadow(0 0 3px rgba(0,0,0,0.5));
}

.podium-place.place-1 {
  order: 2;
  height: 220px;
  border-color: var(--secondary-accent);
  box-shadow: 0 0 15px rgba(244, 67, 54, 0.2);
}
.podium-place.place-2 {
  order: 1;
  height: 200px;
  border-color: var(--accent-color);
}
.podium-place.place-3 {
  order: 3;
  height: 180px;
  border-color: var(--accent-color);
}

.leaderboard-list {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.leaderboard-player-list-item {
  display: flex;
  align-items: center;
  background-color: var(--card-bg);
  padding: 10px 15px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  transition: background-color 0.2s, border-color 0.2s;
}
.leaderboard-player-list-item:hover {
  background-color: var(--border-color);
  border-color: var(--secondary-accent);
}

.player-rank-list {
  font-size: 1.1em;
  font-weight: bold;
  color: var(--text-color);
  opacity: 0.8;
  width: 40px;
  text-align: center;
}

.player-name-list {
  font-weight: 500;
  color: var(--text-color);
  flex-grow: 1;
}

.player-balance-list {
  font-weight: bold;
  color: var(--accent-color);
}

@media (max-width: 600px) {
  .leaderboard-podium {
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }
  .podium-place {
    width: 80%;
    max-width: 250px;
  }
  .podium-place.place-1,
  .podium-place.place-2,
  .podium-place.place-3 {
    order: 0;
    height: auto;
  }
}

/* --- Mobile Navigation Styles --- */
@media (max-width: 850px) {
  .logo {
    height: 35px;
  }
  header h1 {
    font-size: 1.2em;
  }
  .primary-navigation {
    display: block;
    position: fixed;
    inset: 0 0 0 30%;
    background-color: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: min(20vh, 10rem) 2em;
    transform: translateX(100%);
    transition: transform 350ms ease-out;
    z-index: 999;
    border-left: 2px solid var(--accent-color);
  }
  .primary-navigation[data-visible="true"] {
    transform: translateX(0%);
  }

  .primary-navigation ul {
    flex-direction: column;
    gap: 1.5em;
  }
  .primary-navigation ul li a {
    font-size: 1.2em;
  }

  .mobile-nav-toggle {
    display: block;
    order: 2;
  }
  #theme-toggle {
    order: 3;
    margin-left: auto;
  }
  .mobile-nav-controls {
    margin-top: 2em;
    padding-top: 1.5em;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
  }

.primary-navigation ul .dropdown-menu {
  display: none !important; /* Тепер воно 100% буде закритим */
  position: static;
  opacity: 1;
  visibility: visible;
  transform: none;
  box-shadow: none;
  border: none;
  border-left: 2px solid var(--accent-color);
  background: transparent;
  padding: 0;
  margin-top: 10px;
  margin-left: 15px;
}

/* Показуємо меню при натисканні (фокусі або ховері) */
.primary-navigation ul .dropdown:hover .dropdown-menu,
.primary-navigation ul .dropdown:active .dropdown-menu,
.primary-navigation ul .dropdown:focus-within .dropdown-menu {
  display: block !important; /* Відкриваємо тільки тоді, коли треба */
}

.primary-navigation ul .dropdown-menu li a {
  display: block;
  padding: 10px 25px; /* Твої відступи збережені */
  color: var(--text-color-dark);
  font-size: 1.1em;
  text-transform: none;
}

  .mobile-nav-toggle[aria-expanded="true"] .open-icon { display: none; }
  .mobile-nav-toggle[aria-expanded="true"] .close-icon { display: block; }

  body.nav-open {
    overflow: hidden;
  }
}

html {
  scroll-padding-top: 50px;
}

/* --- Hero Section --- */
#hero {
  background: url('../images/hero-background.jpg') no-repeat center center/cover;
  background-color: var(--bg-color-dark);
  text-align: center;
  padding: 60px 0;
  min-height: 55vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  color: #fff;
  border-bottom: 2px solid var(--accent-color);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  background: linear-gradient(0deg, rgba(18,18,18,1) 0%, rgba(0,0,0,0.6) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}
#hero h2 {
  font-size: 3em;
  margin-bottom: 15px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 2px 10px rgba(183, 28, 28, 0.8);
}
#hero p {
  font-size: 1.2em;
  margin-bottom: 25px;
  color: #ddd;
}
.ip-container {
  background-color: rgba(0, 0, 0, 0.8);
  padding: 15px 25px;
  border-radius: 8px;
  display: inline-block;
  margin-bottom: 20px;
  font-size: 1.2em;
  border: 1px solid var(--accent-color);
}
.ip-container span {
  margin-right: 10px;
}
#server-ip {
  font-weight: bold;
  color: var(--text-color-dark);
}
#copy-ip-btn {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 8px 15px;
  margin-left: 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.2s;
  text-transform: uppercase;
  font-weight: bold;
}
#copy-ip-btn:hover {
  background-color: var(--secondary-accent);
}
#copy-ip-btn i {
  margin-right: 5px;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s, transform 0.2s, color 0.3s, border-color 0.3s;
  border: 2px solid transparent;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn i {
  margin-left: 5px;
}
.btn-primary {
  background-color: var(--accent-color);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--secondary-accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(183, 28, 28, 0.4);
}
.btn-secondary {
  background-color: transparent;
  color: var(--text-color);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--border-color);
  color: var(--text-color);
}

/* --- Sections --- */
section {
  padding: 60px 0;
}
#about, #news, #links, #guides-content, #article-content {
  border-bottom: 1px solid var(--border-color);
}
#about p {
  font-size: 1.1em;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

/* --- News Section --- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}
.news-item {
  background-color: var(--card-bg);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.news-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(183, 28, 28, 0.2);
  border-color: var(--accent-color);
}
.news-item img.news-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 15px;
}
.news-item h3 {
  margin-top: 0;
  color: var(--text-color);
  font-size: 1.4em;
}
.news-date {
  font-size: 0.9em;
  color: var(--accent-color);
  font-weight: bold;
  margin-bottom: 10px;
}
.news-item p {
  flex-grow: 1;
  margin-bottom: 20px;
}

/* --- Links Section --- */
.links-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-around;
}
.links-column {
  flex: 1;
  min-width: 280px;
  background-color: var(--card-bg);
  padding: 25px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}
.links-column h3 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.5em;
  color: var(--text-color);
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 10px;
}
.links-column h3 i {
  margin-right: 10px;
  color: var(--accent-color);
}
.links-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.links-list li {
  margin-bottom: 12px;
}
.links-list li a {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  border-radius: 5px;
  transition: background-color 0.2s, color 0.2s;
  font-size: 1.1em;
  border: 1px solid transparent;
  color: var(--text-color);
}
.links-list li a:hover {
  background-color: var(--border-color);
  color: var(--text-color);
  border-color: var(--secondary-accent);
}
.links-list li a i {
  margin-right: 12px;
  font-size: 1.2em;
  width: 20px;
  text-align: center;
  color: var(--secondary-accent);
}

/* --- Gallery Section --- */
#gallery-section {
  padding-bottom: 60px;
}
.gallery-intro {
  text-align: center;
  font-size: 1.1em;
  margin-bottom: 40px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.gallery-loading {
  text-align: center;
  font-size: 1.2em;
  padding: 40px;
  color: var(--text-color);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
@media (min-width: 600px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

.gallery-item {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border-color 0.2s;
  display: flex;
  flex-direction: column;
  height: 300px;
}
.gallery-item:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 16px rgba(183, 28, 28, 0.2);
  border-color: var(--accent-color);
}
.gallery-item img {
  width: 100%;
  height: 75%;
  object-fit: cover;
  display: block;
}
.gallery-item-info {
  padding: 12px 15px;
  font-size: 0.9em;
  text-align: center;
  color: var(--text-color);
  border-top: 1px solid var(--border-color);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.gallery-item-info .author {
  font-weight: bold;
  color: var(--accent-color);
  display: block;
  margin-bottom: 3px;
}
.gallery-item-info .title {
  display: block;
  font-style: italic;
  opacity: 0.8;
}

/* --- Pagination Controls --- */
.pagination-controls {
  text-align: center;
  margin-top: 30px;
}
.pagination-controls button, .pagination-controls span {
  background-color: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 10px 18px;
  margin: 0 5px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.2s, border-color 0.2s;
}
.pagination-controls button:hover:not(:disabled) {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}
.pagination-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.pagination-controls .page-number.current-page {
  background-color: var(--accent-color);
  color: #fff;
  font-weight: bold;
  border-color: var(--accent-color);
}

/* --- Lightbox Modal --- */
.lightbox-modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(18, 18, 18, 0.95);
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
.lightbox-modal.active {
  display: flex;
}
.lightbox-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 85vh;
  border: 2px solid var(--accent-color);
  animation: lightboxZoom 0.3s ease-out;
}
@keyframes lightboxZoom {
  from {transform: scale(0.7); opacity: 0;}
  to {transform: scale(1); opacity: 1;}
}
.lightbox-caption {
  text-align: center;
  color: #ccc;
  padding: 15px 0;
  font-size: 1.1em;
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
}
.lightbox-caption .author {
  font-weight: bold;
  color: var(--secondary-accent);
}
.lightbox-close-btn {
  position: absolute;
  top: 20px;
  right: 35px;
  color: var(--text-color);
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
  z-index: 1002;
}
.lightbox-close-btn:hover {
  color: var(--accent-color);
}

.lightbox-prev, .lightbox-next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -30px;
  color: white;
  font-weight: bold;
  font-size: 24px;
  transition: 0.3s ease;
  user-select: none;
  z-index: 1002;
  background-color: rgba(0,0,0,0.5);
}
.lightbox-prev { left: 20px; border-radius: 3px 0 0 3px; }
.lightbox-next { right: 20px; border-radius: 0 3px 3px 0; }
.lightbox-prev:hover, .lightbox-next:hover { background-color: var(--accent-color); }

/* --- About Section Specific Styles --- */
#about {
  padding-top: 40px;
  line-height: 1.7;
}

#about h2 {
  font-size: 2.8em;
  margin-bottom: 30px;
}

#about h3 {
  font-size: 2em;
  color: var(--text-color);
  margin-top: 50px;
  margin-bottom: 20px;
  text-align: center;
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 10px;
}
#about h3 i {
  margin-right: 10px;
  color: var(--accent-color);
}

#about h4 {
  font-size: 1.6em;
  color: var(--text-color);
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-color);
}

#about h5 {
  font-size: 1.3em;
  color: var(--secondary-accent);
  margin-bottom: 10px;
}

.about-intro-details {
  font-size: 1.1em;
  text-align: center;
  max-width: 900px;
  margin: 0 auto 30px auto;
}

.section-subtitle {
  text-align: center;
  font-size: 1.1em;
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-color);
  opacity: 0.9;
}

.about-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 50px auto;
  width: 80%;
  opacity: 0.5;
}

/* --- НОВИЙ ДИЗАЙН КАРТОК СВІТІВ --- */
.worlds-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.world-zone {
  background-color: var(--card-bg);
  border-radius: 16px;
  padding: 30px 25px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 1px solid var(--border-color);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
  overflow: hidden;
}

.world-zone:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(183, 28, 28, 0.15);
  border-color: var(--border-color);
}

.world-zone::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
}

.zone-icon-wrapper {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 32px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}

.zone-title {
  font-size: 1.8em;
  font-weight: 700;
  margin: 0 0 10px 0;
}

.zone-desc {
  font-size: 1em;
  color: var(--text-color);
  opacity: 0.8;
  margin-bottom: 25px;
  line-height: 1.5;
  min-height: 45px;
}

.zone-details {
  background-color: var(--bg-color);
  width: 100%;
  padding: 15px 20px;
  border-radius: 10px;
  margin-bottom: 25px;
  text-align: left;
  box-sizing: border-box;
  border: 1px solid var(--border-color);
}

.zone-details ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.zone-details li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.95em;
}

.marker {
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 1.2em;
}

.zone-badge {
  margin-top: auto;
  padding: 8px 20px;
  border-radius: 30px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.85em;
}

/* Кольори для зон адаптовано під загальний темний стиль */
.protected-zone::before { background: #555; }
.protected-zone .zone-icon-wrapper { background: #333; color: #fff; }
.protected-zone .zone-title { color: #fff; }
.protected-zone .marker { color: #fff; }
.protected-zone .zone-badge { background: #333; color: #fff; border: 1px solid #555; }

.wild-lands::before { background: var(--accent-color); }
.wild-lands .zone-icon-wrapper { background: rgba(183, 28, 28, 0.2); color: var(--accent-color); }
.wild-lands .zone-title { color: var(--accent-color); }
.wild-lands .marker { color: var(--accent-color); }
.wild-lands .zone-badge { background: var(--accent-color); color: white; }

/* --- Features Grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 25px;
  margin-top: 20px;
}
.feature-item {
  background-color: var(--card-bg);
  padding: 20px 25px;
  border-radius: 8px;
  border-left: 4px solid var(--accent-color);
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.feature-item ul {
  list-style: disc;
  padding-left: 20px;
}

/* --- Playstyles & Conclusion --- */
.playstyles-list {
  list-style: none;
  padding-left: 0;
  text-align: center;
  margin-bottom: 20px;
}
.playstyles-list li {
  display: inline-block;
  margin: 5px 10px;
  padding: 8px 15px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 1em;
}
.playstyles-list li strong {
  color: var(--secondary-accent);
}
.about-conclusion {
  text-align: center;
  font-size: 1.2em;
  font-weight: bold;
  margin-top: 20px;
}

/* --- Join Us Section --- */
.join-us-section {
  background-color: var(--card-bg);
  padding: 30px;
  border-radius: 8px;
  margin-top: 30px;
  text-align: center;
  border: 2px solid var(--border-color);
}
.join-us-section h3 {
  margin-top: 0;
  border-bottom: none;
  padding-bottom: 0;
  color: var(--text-color);
}
.server-info-box {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 15px 20px;
  border-radius: 6px;
  margin: 20px auto;
  display: inline-block;
  text-align: left;
}
.server-info-box code {
  background-color: var(--border-color);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'Courier New', Courier, monospace;
  color: var(--secondary-accent);
  font-weight: bold;
}
.server-info-box i {
  color: var(--accent-color);
}
.final-cta {
  font-size: 1.3em;
  font-weight: bold;
  margin-top: 20px;
  color: var(--secondary-accent);
}

.about-links-reminder {
  margin-top: 40px;
  padding: 15px;
  background-color: var(--card-bg);
  border-left: 5px solid var(--accent-color);
  border-radius: 0 5px 5px 0;
  font-size: 0.95em;
  text-align: center;
}
.about-links-reminder p i {
  margin-right: 8px;
  color: var(--accent-color);
}

/* --- Guides Page --- */
#guides-content h2 { margin-bottom: 40px; }

.collapsible-guide {
  background-color: var(--card-bg);
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}
.collapsible-guide .guide-summary {
  padding: 20px 25px;
  cursor: pointer;
  display: block;
  font-weight: bold;
  color: var(--text-color);
  transition: background-color 0.2s;
  position: relative;
}
.collapsible-guide .guide-summary h3 {
  margin: 0;
  font-size: 1.5em;
  color: inherit;
}
.collapsible-guide .guide-summary:hover {
  background-color: var(--border-color);
}
.collapsible-guide .guide-summary::-webkit-details-marker,
.collapsible-guide .guide-summary::marker {
  display: none;
}
.collapsible-guide .guide-summary::before {
  content: '\25B6';
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  transition: transform 0.2s ease-in-out;
  font-size: 0.9em;
  color: var(--accent-color);
}
.collapsible-guide[open] > .guide-summary::before {
  transform: translateY(-50%) rotate(90deg);
}

.alert {
  padding: 15px 20px;
  margin: 20px 0;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.95em;
}
.alert-info {
  color: #fff;
  background-color: #2b2b2b;
  border-color: #444;
}
.alert-warning {
  color: #fff;
  background-color: rgba(183, 28, 28, 0.3);
  border-color: var(--accent-color);
}

.guide-content-wrapper pre {
  background-color: #0a0a0a;
  padding: 15px;
  border-radius: 5px;
  border: 1px solid var(--border-color);
  overflow-x: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  color: #dcdcdc;
}

.guide-content-wrapper {
  padding: 0px 25px 25px 25px;
  border-top: 1px solid var(--border-color);
}

/* --- News Page Layout --- */
.news-page-layout { display: flex; gap: 30px; align-items: flex-start; position: relative; }
.news-list-full { display: flex; flex-direction: column; gap: 30px; flex: 1; min-width: 0; }
.news-sidebar { width: 300px; flex-shrink: 0; display: none; }
@media (min-width: 992px) { .news-sidebar { display: block; } }

.news-sidebar-sticky {
  position: sticky; top: 90px; max-height: 80vh; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--border-color) transparent;
}
.sidebar-widget {
  background-color: var(--card-bg); border: 1px solid var(--border-color);
  border-radius: 12px; padding: 20px;
}
.sidebar-widget h3 { color: var(--text-color); border-bottom: 1px solid var(--accent-color); }
.news-sidebar-nav li a:hover { color: var(--secondary-accent); }
.news-sidebar-nav li a.active { border-left-color: var(--accent-color); }

.full-news-card {
  background-color: var(--card-bg); border: 1px solid var(--border-color);
  border-radius: 12px; overflow: hidden;
}
.full-news-card:hover { border-color: var(--accent-color); }
.news-title { color: var(--text-color); }
.news-short-desc { color: var(--text-color); opacity: 0.8; }
.news-card-full-content { background-color: var(--bg-color); }

/* --- Whitelist Modal Styles --- */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85); display: flex;
  justify-content: center; align-items: center; z-index: 9999;
}
.modal-content {
  background: var(--card-bg); padding: 30px; border-radius: 10px;
  width: 90%; max-width: 500px; border: 1px solid var(--accent-color);
  color: var(--text-color); box-shadow: 0 5px 25px rgba(183, 28, 28, 0.3);
}
.close-modal:hover { color: var(--secondary-accent); }
#whitelistForm .form-group input[type="text"]:focus { border-color: var(--secondary-accent); }
#whitelistForm .submit-btn { background: var(--accent-color); }
#whitelistForm .submit-btn:hover:not(:disabled) { background: var(--secondary-accent); color: white; }

/* --- Footer --- */
footer {
  background-color: var(--bg-color);
  color: var(--text-color);
  text-align: center;
  padding: 30px 0;
  margin-top: auto;
  border-top: 2px solid var(--accent-color);
}

/* =========================================================================
   ВИПАДАЮЧЕ МЕНЮ (НАВІГАЦІЯ) - ЄДИНИЙ ПРАВИЛЬНИЙ БЛОК
   ========================================================================= */

/* Десктопна версія (ПК) */
@media (min-width: 851px) {
  .dropdown {
    position: relative;
  }

  .dropdown .dropdown-icon {
    font-size: 0.8em;
    margin-left: 5px;
    transition: transform 0.3s ease;
  }

  .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--card-bg-dark); /* Темний фон */
    border: 1px solid var(--border-color-dark);
    border-top: 3px solid var(--accent-color); /* Червона лінія зверху */
    border-radius: 0 0 8px 8px;
    padding: 10px 0;
    list-style: none;
    margin: 0;
    min-width: 220px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); /* Тінь */

    /* Анімація появи: сховано за замовчуванням */
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s ease;
    z-index: 1000;
  }

  /* Показуємо меню при наведенні */
  .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  /* Переворот стрілки */
  .dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
  }

  .dropdown-menu li {
    width: 100%;
  }

  /* Робимо селектор сильнішим, щоб перебити старі нульові відступи */
  .primary-navigation ul .dropdown-menu li a {
    display: block;
    padding: 12px 25px; /* Тепер ці 25px точно спрацюють */
    color: var(--text-color-dark);
    font-size: 0.95em;
    text-transform: none;
    font-weight: normal;
    box-sizing: border-box;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s, padding-left 0.3s;
  }

  /* Ефект при наведенні */
  .primary-navigation ul .dropdown-menu li a:hover {
    background-color: rgba(183, 28, 28, 0.15);
    color: var(--secondary-accent);
    padding-left: 35px; /* Зсув тексту вправо працюватиме ідеально */
  }
}

/* Мобільна версія */
@media (max-width: 850px) {
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--accent-color);
    background: transparent;
    padding: 0;
    margin-top: 10px;
    margin-left: 15px;
    display: none; /* Ховаємо до кліку/ховеру */
  }

  .dropdown:hover .dropdown-menu,
  .dropdown:active .dropdown-menu {
    display: block;
  }

  .primary-navigation ul .dropdown-menu li a {
    display: block;
    padding: 10px 25px;
    color: var(--text-color-dark);
    font-size: 1.1em;
    text-transform: none;
  }
}
