:root {
  --primary-accent: #00ffcc;
  --primary-glow: rgba(0, 255, 204, 0.2);
  --secondary-accent: #ff8e53;
  --secondary-glow: rgba(255, 142, 83, 0.2);
  --bg-color: #0f0f0f;
  --surface-color: rgba(24, 24, 24, 0.65);
  --surface-border: rgba(255, 255, 255, 0.08);
  --sidebar-color: rgba(18, 18, 18, 0.7);
  --nav-color: rgba(22, 22, 22, 0.75);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding-top: 110px;
  font-family: var(--font-family);
  background: var(--bg-color);
  color: #ffffff;
  overflow-x: hidden;
}

/* ───── НАВИГАЦИЯ ───── */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 12px 0;
  background: var(--nav-color);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border-bottom: 1px solid var(--surface-border);
  z-index: 1000;
  transition: all 0.3s ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
}

.logo-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary-accent) 0%, #00ccff 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--primary-glow);
}

.logo-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.logo-text {
  font-size: 19px;
  font-weight: 700;
  background: linear-gradient(135deg, #61ff9d 0%, var(--primary-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* IP Copy Container */
.server-ip-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 255, 204, 0.05);
  border: 1px solid rgba(0, 255, 204, 0.15);
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.server-ip-container:hover {
  background: rgba(0, 255, 204, 0.12);
  border-color: rgba(0, 255, 204, 0.4);
  box-shadow: 0 0 12px var(--primary-glow);
  transform: translateY(-1px);
}

.server-ip-container:active {
  transform: translateY(0);
}

.ip-label {
  color: #888888;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ip-address {
  color: var(--primary-accent);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.ip-tooltip {
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background: #181818;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--surface-border);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.server-ip-container:hover .ip-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ip-tooltip.copied {
  background: var(--primary-accent);
  color: #0c0c0c;
  border-color: var(--primary-accent);
}

.nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: #ffffff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav-links a::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #ff6b6b, var(--secondary-accent));
  transition: all 0.3s ease;
  transform: translateX(-50%);
  border-radius: 2px;
}

.nav-links a:hover {
  color: var(--secondary-accent);
  text-shadow: 0 0 8px rgba(255, 142, 83, 0.4);
}

.nav-links a:hover::before {
  width: 100%;
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-accent), #00ccff);
  transform: translateX(-50%);
  box-shadow: 0 0 10px var(--primary-glow);
  border-radius: 2px;
}

/* ───── МАКЕТ И СЕТКА ───── */
.main-container {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  gap: 40px;
  align-items: flex-start;
}

/* Боковая панель */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 110px;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  padding-right: 15px;
  border-right: 1px solid var(--surface-border);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

/* Поиск по вики */
.search-container {
  position: relative;
  margin-bottom: 12px;
}

#wiki-search {
  width: 100%;
  box-sizing: border-box;
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid var(--surface-border);
  color: #ffffff;
  padding: 10px 35px 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font-family);
  transition: all 0.25s ease;
}

#wiki-search:focus {
  outline: none;
  border-color: var(--primary-accent);
  box-shadow: 0 0 10px var(--primary-glow);
  background: rgba(30, 30, 30, 0.9);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  cursor: pointer;
  font-size: 18px;
  display: none;
  line-height: 1;
  transition: color 0.2s ease;
}

.search-clear-btn:hover {
  color: #fff;
}

/* Красивая кастомная полоса прокрутки для боковой панели */
.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 204, 0.3);
}

/* Область контента */
.content-area {
  flex-grow: 1;
  min-width: 0;
}

.content-block {
  animation: fadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ───── КНОПКИ И ТЕКСТ ───── */
.sidebar-btn {
  box-sizing: border-box;
  width: 100%;
  color: #888888;
  text-align: left;
  display: block;
  padding: 10px 16px;
  background: transparent;
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-family);
}

.sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.03);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.05);
}

/* Активный статус кнопки */
.sidebar-btn.active {
  background: rgba(0, 255, 204, 0.05) !important;
  color: #ffffff !important;
  border-color: rgba(0, 255, 204, 0.2) !important;
  font-weight: 600;
  box-shadow: inset 0 0 10px rgba(0, 255, 204, 0.03);
}

/* Кнопка копирования команды */
.copy-cmd-btn {
  background: transparent;
  border: none;
  color: #555555;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  vertical-align: middle;
  transition: all 0.2s ease;
}

.copy-cmd-btn:hover {
  color: var(--primary-accent);
  background: rgba(0, 255, 204, 0.08);
}

.copy-cmd-btn:active {
  transform: scale(0.9);
}

.cmd-text {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
}

/* Поиск результатов подсвечивание */
.search-highlight {
  background: rgba(0, 255, 204, 0.25);
  border-bottom: 2px solid var(--primary-accent);
  border-radius: 2px;
  color: #fff;
  padding: 0 2px;
}

.text {
  box-sizing: border-box;
  color: #888888;
  text-align: left;
  display: block;
  padding: 10px 15px;
  background: transparent;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 15px 0 5px 0;
  border: none;
}

/* ───── КОНТЕНТНЫЕ КЛАССЫ ───── */
.con1 {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.con2 {
  font-size: 16px;
  font-weight: 600;
  color: #00ffcc;
  margin-bottom: 15px;
  background: rgba(0, 255, 204, 0.05);
  padding: 10px 15px;
  border-radius: 6px;
  border-left: 3px solid #00ffcc;
}

.con3 {
  font-size: 15px;
  font-weight: 500;
  color: #eaeaea;
  line-height: 1.6;
  margin-bottom: 15px;
}

.con4 {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin: 25px 0 15px 0;
}

.con5 {
  font-size: 16px;
  font-weight: 600;
  color: #ff8e53;
  margin-bottom: 15px;
  background: rgba(255, 142, 83, 0.05);
  padding: 10px 15px;
  border-radius: 6px;
  border-left: 3px solid #ff8e53;
}

.con6 {
  font-size: 16px;
  font-weight: 600;
  color: #aaaaaa;
  margin-bottom: 15px;
}

.con7 {
  font-size: 15px;
  font-weight: 500;
  color: #eaeaea;
  line-height: 1.6;
  margin-bottom: 10px;
}

.con8 {
  font-size: 13px;
  font-weight: 500;
  color: #cccccc;
  margin-bottom: 8px;
}

.con9 {
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.6;
  margin-bottom: 15px;
  padding: 15px;
  background: #1f1f1f;
  border-radius: 8px;
}

.con10 {
  font-size: 15px;
  font-weight: 500;
  color: #dddddd;
  margin-bottom: 10px;
}

.con15 {
  font-size: 15px;
  font-weight: 500;
  color: #dddddd;
  margin-bottom: 10px;
}

.con16 {
  font-size: 14px;
  color: #bbbbbb;
  margin-left: 20px;
  margin-bottom: 8px;
  position: relative;
}

.con16::before {
  content: '▫︎';
  position: absolute;
  left: -15px;
  color: #ff8e53;
}

.con17 {
  font-size: 14px;
  color: #ffffff;
  margin-left: 10px;
  margin-top: 15px;
  margin-bottom: 8px;
  position: relative;
  font-weight: 600;
}

.con17::before {
  content: '▪︎';
  position: absolute;
  left: -15px;
  color: #00ffcc;
}

/* ───── ИЗОБРАЖЕНИЯ И МЕДИА ───── */
.img-container {
  max-width: 600px;
  margin: 20px 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

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

/* ───── КАСТОМНЫЕ ПРЕДМЕТЫ ГРИД ───── */
.custom-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 25px;
}

.item-card {
  background: #1f1f1f;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.item-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 255, 204, 0.4);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.item-title {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 12px;
  text-align: center;
}

.item-image {
  width: 128px;
  height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 8px;
}

.item-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ───── ТАБЛИЦЫ ───── */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.team-table {
  width: 100%;
  border-collapse: collapse;
  background: #1c1c1c;
  color: #eaeaea;
}

.team-table thead {
  background: #252525;
}

.team-table th {
  text-align: left;
  padding: 14px 18px;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #00ffcc;
  border-bottom: 2px solid rgba(255, 255, 255, 0.05);
}

.team-table td {
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14px;
  line-height: 1.5;
}

.team-table tbody tr {
  transition: background 0.25s ease;
}

.team-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.team-table td:first-child {
  font-weight: 600;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 13px;
  width: 35%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ───── ВИДЖЕТ РАНГОВ ───── */
.ranks-widget {
  background: #1c1c1c;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.ranks-widget .tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.ranks-widget .tab {
  padding: 10px 18px;
  cursor: pointer;
  background: #0f0f0f;
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #9a9a9a;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.ranks-widget .tab:hover {
  color: #ffffff;
  background: #252525;
}

.ranks-widget .tab.active {
  background: #303030;
  color: #ffffff;
  border-color: #00ffcc;
}

.ranks-widget .rank-card {
  background: #0f0f0f;
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 20px;
}

.ranks-widget .rank-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
}

.ranks-widget .rank-tag {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  margin-left: 8px;
}

.ranks-widget .knight {
  background: linear-gradient(135deg, #facc15, #fb923c);
  color: #1a1200;
}

.ranks-widget .duke {
  background: linear-gradient(135deg, #2dd4bf, #38bdf8);
  color: #022c22;
}

.ranks-widget .graf {
  background: #8b5cf6;
  color: #ffffff;
}

.ranks-widget .king {
  background: #068010;
  color: #ffffff;
}

.ranks-widget .emperor {
  background: #ef4444;
  color: #ffffff;
}

.ranks-widget .section-title {
  margin-top: 20px;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888888;
}

.ranks-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.ranks-widget li {
  padding: 6px 10px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  color: #cfcfcf;
}

.ranks-widget .command {
  font-family: monospace;
  color: #00ffcc;
  font-weight: 600;
}

/* Кнопка Ресурс-пака */
.mc-button {
  text-decoration: none;
  font-weight: 600;
  color: #ffffff;
  text-align: center;
  display: inline-block;
  padding: 12px 30px;
  background: #141414;
  border-radius: 10px;
  font-size: 14px;
  border: 1px solid rgba(0, 255, 204, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
}

.mc-button:hover {
  background: #00ffcc;
  color: #141414;
  box-shadow: 0 0 15px rgba(0, 255, 204, 0.3);
}

.hidden {
  display: none !important;
}

.fade-out {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.fade-in {
  opacity: 1;
  transition: opacity 0.25s ease;
}

/* ───── АДАПТИВНОСТЬ (МЕДИА-ЗАПРОСЫ) ───── */
@media (max-width: 900px) {
  body {
    padding-top: 90px;
  }

  .main-container {
    flex-direction: column;
    gap: 30px;
    padding: 15px;
  }

  .sidebar {
    width: 100%;
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 10px;
    padding-right: 0;
    border-right: none;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
  }

  /* Скрываем заголовки в мобильном сайдбаре, чтобы оставить только кнопки */
  .sidebar .text {
    display: none;
  }

  .sidebar .button,
  .sidebar .button2,
  .sidebar .button3 {
    width: auto;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 10px 18px;
    font-size: 12px;
  }

  .nav-container {
    padding: 0 15px;
  }

  .nav-links {
    gap: 15px;
  }

  .nav-links a {
    font-size: 15px;
  }
}

@media (max-width: 600px) {
  .logo-text {
    display: none;
    /* скрываем текст логотипа на очень маленьких экранах */
  }

  .con1 {
    font-size: 20px;
  }

  .con2,
  .con5 {
    font-size: 14px;
    padding: 8px 12px;
  }

  .team-table td,
  .team-table th {
    padding: 10px 12px;
    font-size: 13px;
  }

  .team-table td:first-child {
    font-size: 13px;
  }
}

/* ───── МОДАЛЬНОЕ ОКНО ДЛЯ ИЗОБРАЖЕНИЙ (LIGHTBOX) ───── */
.lightbox {
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.lightbox:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(0, 255, 204, 0.2);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.lightbox:not(.hidden) .lightbox-content {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: #ffffff;
  font-size: 60px;
  font-weight: 300;
  cursor: pointer;
  transition: color 0.2s ease;
  user-select: none;
}

.lightbox-close:hover {
  color: #00ffcc;
}

/* Cursor style for zoomable items */
.item-image img {
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.item-image img:hover {
  transform: scale(1.05);
}