/* ===================== БАЗА ===================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Manrope', Arial, sans-serif;
  overflow-x: hidden;
  background-color: #05070a;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===================== ФОН ===================== */
.bg {
  position: fixed;
  inset: -40px;
  background-image: url("фото.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(5px) brightness(0.75);
  z-index: -2;
}

/* Safari (iPhone/iPad): fixed-фон іноді "смикається" при скролі,
   тому на iOS перемикаємо на звичайне позиціонування */
@supports (-webkit-touch-callout: none) {
  .bg {
    position: absolute;
    background-attachment: scroll;
  }
}
/* ===================== ГОДИННИК ===================== */
.clock {
  position: fixed;
  top: 20px;
  right: 24px;
  background: rgba(10, 14, 22, 0.65);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 8px 16px;
  border-radius: 10px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(6px);
  z-index: 10;
}

/* ===================== HERO ===================== */
.hero {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(24px, 6vw, 80px);
  flex-wrap: wrap;
  max-width: 1400px;
  margin: 0 auto clamp(32px, 5vw, 48px);
  padding-top: clamp(60px, 10vw, 90px);
  padding-bottom: clamp(20px, 4vw, 30px);
  padding-left: clamp(16px, 6vw, 80px);
  padding-right: clamp(16px, 6vw, 80px);
  animation: fadeInUp 0.8s ease-out;
  min-width: 0;
}

.hero-text {
  flex: 0 1 560px;
}

.join-box {
  flex: 0 1 340px;
}
.hero-text {
  max-width: 560px;
  min-width: 0;
}

.hero-text h1 {
  color: #ffffff;
  font-size: clamp(1.75rem, 5vw, 2.875rem);
  font-weight: 800;
  margin-bottom: 18px;
  line-height: 1.25;
  text-shadow: 0 2px 4px rgba(0,0,0,0.9), 0 0 24px rgba(0,0,0,0.6);
  overflow-wrap: anywhere;
}

.hero-text h1 span {
  color: #ff4d4d;
}

.hero-text p {
  color: #f0f2f5;
  font-size: clamp(0.8125rem, 2vw, 1rem);
  line-height: 1.7;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 18px rgba(0,0,0,0.6);
  overflow-wrap: anywhere;
}

.hero-text p .accent2 {
  color: #4d9fff;
  font-weight: 700;
}

/* ===================== JOIN BOX ===================== */
.join-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 280px;
  width: min(100%, 340px);
  background: rgba(10, 14, 22, 0.6);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 14px;
  padding: 16px;
  backdrop-filter: blur(8px);
}

.join-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ff4d4d;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 0;
}

.join-row-text {
  display: flex;
  flex-direction: column;
  margin-right: auto;
  line-height: 1.3;
  min-width: 0;
}

.join-label {
  color: #9aa2b1;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.join-row-text b {
  color: #ffffff;
  font-size: 15px;
}

#copyBtn {
  background: #ff4d4d;
  border: none;
  color: white;
  padding: 7px 14px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.2s;
  flex-shrink: 0;
}

.join-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(77, 159, 255, 0.18);
  border: 1px solid #4d9fff;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.2s;
  touch-action: manipulation;
}

.join-link.telegram {
  background: rgba(77, 200, 255, 0.15);
  border-color: #4dc8ff;
}

/* ===================== ВКЛАДКИ ===================== */
.menu-tabs {
  display: flex;
  gap: 12px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto 24px;
  padding-left: clamp(16px, 6vw, 80px);
  padding-right: clamp(16px, 6vw, 80px);
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeInUp 0.8s ease-out 0.15s backwards;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #e5e9f0;
  padding: 10px 22px;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(6px);
  touch-action: manipulation;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.tab-btn.active {
  background: #ff4d4d;
  border-color: #ff4d4d;
  color: #ffffff;
}

.tab-content {
  display: none;
  background: rgba(10, 13, 20, 0.8);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  max-width: 1400px;
  margin: 0 auto clamp(60px, 8vw, 100px);
  margin-left: max(clamp(12px, 6vw, 80px), calc((100% - 1400px) / 2));
  margin-right: max(clamp(12px, 6vw, 80px), calc((100% - 1400px) / 2));
  padding: clamp(18px, 4vw, 40px);
  backdrop-filter: blur(10px);
  animation: fadeInUp 0.5s ease-out;
}

.tab-content.active {
  display: block;
}

.tab-content h2 {
  color: #ffffff;
  font-size: clamp(1.375rem, 4vw, 2rem);
  font-weight: 800;
  margin-bottom: 12px;
  border-bottom: 3px solid #ff4d4d;
  display: inline-block;
  padding-bottom: 6px;
}

.placeholder-text {
  color: #9aa2b1;
  font-size: 15px;
  margin-top: 16px;
  text-align: center;
}

/* ===================== ПОШУК ===================== */
.text-input {
  display: block;
  width: 100%;
  padding: 13px 16px;
  margin: 16px 0 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: white;
  font: inherit;
  font-size: 15px;
}

.text-input::placeholder {
  color: #9aa2b1;
}

.search-results {
  margin-bottom: 20px;
}

.search-result-item {
  background: rgba(255, 77, 77, 0.12);
  border: 1px solid rgba(255, 77, 77, 0.35);
  border-radius: 8px;
  padding: 10px 14px;
  color: #ffdada;
  font-size: 14px;
  margin-bottom: 8px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.2s;
}

.search-result-item.no-results {
  cursor: default;
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.15);
  color: #9aa2b1;
}

/* ===================== СІТКИ ===================== */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
  gap: 14px;
}

.rule-card {
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  padding: 20px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
}

.rule-num {
  color: #ff4d4d;
  font-weight: 800;
  margin-right: 8px;
}

.roles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: stretch;
  gap: 20px;
}

.role-card {
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 14px;
  padding: 28px;
  color: #ffffff;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
  border-left: 4px solid #ff4d4d;
}

.role-card-text h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}

.role-card-text p {
  font-size: 13px;
  color: #9aa2b1;
}

/* ===================== МОДАЛКИ ===================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: rgba(18, 21, 30, 0.97);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 18px;
  width: min(92vw, 640px);
  max-height: min(85vh, 85dvh);
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  animation: fadeInUp 0.25s ease-out;
  scrollbar-width: none;
}

.modal-box::-webkit-scrollbar {
  display: none;
}

.modal-header {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: rgba(18, 21, 30, 0.99);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  z-index: 1;
}

.modal-header span {
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
}

#modalClose, #staffModalClose {
  background: rgba(255,255,255,0.08);
  border: none;
  color: #9aa2b1;
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.2s, color 0.2s;
}

.modal-body {
  padding: 24px;
  touch-action: pan-y;
}

.article-title {
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  margin-top: 20px;
}

.article-title:first-child {
  margin-top: 0;
}

.article-text {
  color: #dfe3ea;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 10px;
}

.article-paragraph {
  margin-bottom: 12px;
}

.article-paragraph:last-child {
  margin-bottom: 0;
}

.article-punishment {
  background: rgba(255, 77, 77, 0.12);
  border-left: 3px solid #ff4d4d;
  color: #ffb3b3;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 6px;
}

.article-image {
  width: 100%;
  max-width: 320px;
  border-radius: 10px;
  margin: 12px 0;
  display: block;
  cursor: zoom-in;
  touch-action: manipulation;
}

.highlight {
  background: rgba(255, 220, 0, 0.55);
  color: #1a1a1a;
  border-radius: 3px;
  padding: 0 2px;
  transition: background 0.4s ease;
}

.highlight.fade-out {
  background: transparent;
  color: inherit;
}

/* ===================== СПІВРОБІТНИКИ ===================== */
.staff-member {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  min-width: 0;
}

.staff-member img {
  width: 68px;
  height: 68px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.staff-member-text {
  min-width: 0;
}

.staff-member-text b {
  color: #ffffff;
  font-size: 16px;
  display: block;
  margin-bottom: 2px;
  overflow-wrap: anywhere;
}

.staff-member-text span {
  color: #9aa2b1;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.staff-member-text a {
  color: #4d9fff;
  text-decoration: none;
}

/* ===================== ЛІЦЕНЗІЇ ===================== */
.license-check-box {
  max-width: 700px;
  margin: 20px auto 30px;
  text-align: center;
}

.license-check-label {
  color: #9aa2b1;
  font-size: 14px;
  margin-bottom: 16px;
}

.license-check-row {
  display: flex;
  gap: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 16px;
  flex-wrap: wrap;
  min-width: 0;
}

.license-select,
.license-input {
  flex: 1 1 160px;
  min-width: 0;
  padding: 12px 10px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: #ffffff;
  font: inherit;
  font-size: 13px;
}

.license-select {
  cursor: pointer;
  text-overflow: ellipsis;
}

.license-select option {
  background: #14161e;
  color: #ffffff;
}

.license-input::placeholder {
  color: #9aa2b1;
}

.license-search-btn {
  background: #ff4d4d;
  border: none;
  color: white;
  padding: 0 24px;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.license-result-card {
  max-width: 500px;
  margin: 0 auto;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(77, 255, 140, 0.4);
  border-radius: 14px;
  padding: 24px;
  animation: fadeInUp 0.3s ease-out;
}

.license-result-card.invalid {
  border-color: rgba(255, 77, 77, 0.5);
}

.license-result-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(77, 255, 140, 0.15);
  color: #7dffb0;
}

.license-result-status.invalid {
  background: rgba(255, 77, 77, 0.15);
  color: #ff9a9a;
}

.license-result-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-wrap: wrap;
}

.license-result-row:last-child {
  border-bottom: none;
}

.license-result-row span:first-child {
  color: #9aa2b1;
  font-size: 13px;
}

.license-result-row span:last-child {
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ===================== LIGHTBOX ===================== */
.image-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 200;
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
}

.image-lightbox.active {
  display: flex;
}

.image-lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  transition: transform 0.2s ease;
}

/* ===================== HOVER (тільки для пристроїв з мишею) ===================== */
@media (hover: hover) {
  #copyBtn:hover { background: #e63e3e; }
  .join-link:hover { background: rgba(77, 159, 255, 0.32); }
  .join-link.telegram:hover { background: rgba(77, 200, 255, 0.3); }
  .tab-btn:hover { background: rgba(255,255,255,0.16); transform: translateY(-2px); }
  .rule-card:hover { background: rgba(255,255,255,0.14); border-color: #ff4d4d; transform: translateY(-2px); }
  .role-card:hover { background: rgba(255,255,255,0.14); border-color: #4d9fff; transform: translateY(-2px); }
  #modalClose:hover, #staffModalClose:hover { background: rgba(255,77,77,0.25); color: #ffffff; }
  .search-result-item:hover { background: rgba(255, 77, 77, 0.22); }
  .search-result-item.no-results:hover { background: rgba(255,255,255,0.05); }
  .license-search-btn:hover { background: #e63e3e; }
  .staff-member-text a:hover { text-decoration: underline; }
}

/* ===================== СКРОЛБАР ===================== */
body {
  scrollbar-width: none;
}

body::-webkit-scrollbar {
  display: none;
}

/* ===================== ДОСТУПНІСТЬ ===================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}