* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
  min-height: 100vh;
  color: #333;
}

/* === HEADER === */
.site-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #1a2a6c;
}

.logo-img {
  height: 35px;
  width: auto;
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, #1a2a6c, #b21f1f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-nav {
  display: flex;
  gap: 15px;
}

.nav-link {
  color: #1a2a6c;
  text-decoration: none;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.nav-link:hover {
  background: linear-gradient(45deg, #a1c4fd, #c2e9fb);
  color: white;
}

/* === MAIN LAYOUT === */
.main-layout {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  gap: 20px;
  padding: 30px 20px;
  width: 100%;
  box-sizing: border-box;
}

.sidebar {
  position: sticky;
  top: 80px;
  height: fit-content;
  min-width: 0;
  align-self: start; /* Чтобы sidebar не растягивался на всю высоту */
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 15px; /* ЗАЗОР МЕЖДУ ВИДЖЕТАМИ */
}

.main-content {
  min-height: 600px;
  min-width: 0;
  text-align: center;
}

/* === ЗАГОЛОВОК === */
h1 {
  color: white;
  margin-bottom: 30px;
  font-size: 2.8rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
h2 {
  color: #bce8f1;
  margin-bottom: 30px;
  margin-top: -20px;
  font-size: 1.8rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* === КНОПКИ === */
.buttons-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 30px;
}

.modal-btn {
  background: white;
  color: #1a2a6c;
  border: none;
  padding: 14px 22px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
  max-width: 100%;
  justify-content: center;
  flex: 1;
}

.modal-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.3);
}

.modal-btn i {
  font-size: 1.5rem;
}

.banner-btn { background: linear-gradient(45deg, #ff9a9e, #fad0c4); }
.instruction-btn { background: linear-gradient(45deg, #a1c4fd, #c2e9fb); }
.rules-btn { background: linear-gradient(45deg, #d4fc79, #96e6a1); }
.disabled-btn {
  background: linear-gradient(45deg, #b5b4b4, #8f8e8e);
  color: #111010 !important;
  cursor: not-allowed !important;
}

/* === БЕГУЩАЯ СТРОКА === */
.ad-marquee-wrapper {
  width: 100%;
  margin-top: -20px;
  margin: 0 auto 15px auto;
  overflow: hidden;
  background: #e8f1bc;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 0;
  min-height: 36px;
  display: flex;
  align-items: center;
}

.ad-marquee-track {
  display: inline-block;
  white-space: nowrap;
  animation: scroll-left 70s linear infinite;
  padding-left: 100%;
  line-height: 1;
}

.ad-marquee-track:hover {
  animation-play-state: paused;
}

@keyframes scroll-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

#linkcode_56 {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  margin: 0 !important;
  padding: 0 !important;
}

#linkcode_56 a {
  color: #1a2a6c !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  white-space: nowrap !important;
  transition: color 0.2s !important;
  line-height: 1.2 !important;
  margin: 0 !important;
  padding: 0 !important;
}

#linkcode_56 a:hover {
  color: #b21f1f !important;
  text-decoration: underline !important;
}

.ad-main-cta {
  display: inline-block;
  margin: 0 auto 30px auto;
  background: linear-gradient(45deg, #9efb93, #126006);
  color: white !important;
  padding: 10px 30px;
  border-radius: 15px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 15px rgba(18, 96, 6, 0.4);
  transition: all 0.3s ease;
}

.ad-main-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(18, 96, 6, 0.6);
}

/* === БАННЕРЫ === */
.banners-section {
  color: white;
  margin-bottom: 30px;
}

.banners-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.banner-card {
  display: inline-block;
}

.banner-card img {
  width: 468px;
  height: 60px;
  object-fit: cover;
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.message {
  display: block;
  padding: 10px;
}

.refLink {
  padding: 15px;
  color: cornflowerblue;
}

/* === ВИДЖЕТЫ (ОДИН РАЗ, БЕЗ ДУБЛЕЙ!) === */
.widget {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-align: center;
}

.widget-title {
  color: #1a2a6c;
  font-size: 1rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0f0f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.widget-content p {
  margin-bottom: 6px;
  word-break: break-word;
}

.partner-link, .social-link {
  display: block;
  color: #1a2a6c;
  text-decoration: none;
  padding: 6px 10px;
  background: #f5f5f5;
  border-radius: 8px;
  margin-bottom: 6px;
  transition: all 0.3s ease;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.partner-link:hover, .social-link:hover {
  background: linear-gradient(45deg, #a1c4fd, #c2e9fb);
  color: white;
}

.top-list {
  padding-left: 18px;
  margin: 0;
  text-align: left;
}

.top-list li {
  margin-bottom: 6px;
  color: #333;
  font-size: 0.85rem;
  word-break: break-word;
}

/* === ЦЕНТРИРОВАНИЕ БАННЕРОВ В ВИДЖЕТАХ === */
.widget-content div[id^="bancode_"] {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 50px;
}

.widget-content div[id^="bancode_"] * {
  float: none !important;
  position: static !important;
  display: block;
  margin: 0 auto;
}

.widget-content img,
.widget-content iframe,
.widget-content a {
  max-width: 240px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 10px;
}

/* === МОДАЛЬНЫЕ ОКНА === */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: none;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: white;
  border-radius: 15px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
  z-index: 1001;
  width: 90%;
  max-width: 600px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.modal-header {
  padding: 25px;
  background: linear-gradient(135deg, #1a2a6c, #b21f1f);
  border-radius: 15px 15px 0 0;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.8rem;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  transition: transform 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-btn:hover {
  transform: rotate(360deg);
}

.modal-body {
  padding: 30px;
  max-height: 80vh;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 25px;
  text-align: left;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: #1a2a6c;
}

input, textarea, select {
  width: 100%;
  padding: 14px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #1a2a6c;
  box-shadow: 0 0 0 3px rgba(26, 42, 108, 0.2);
}

.submit-btn {
  background: linear-gradient(135deg, #1a2a6c, #b21f1f);
  color: white;
  border: none;
  padding: 15px 30px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(26, 42, 108, 0.3);
}

.submit-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(26, 42, 108, 0.4);
}

.rules-list, .instruction-steps {
  text-align: left;
  padding-left: 20px;
}

.rules-list li, .instruction-steps li {
  margin-bottom: 15px;
  line-height: 1.6;
}

.info-section {
  background: #f9f9f9;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 25px;
}

.info-section h3 {
  margin-bottom: 15px;
  color: #1a2a6c;
  font-size: 1.3rem;
}

/* === FEATURES === */
.features {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-top: 30px;
}

.feature {
  background: rgba(255, 255, 255, 0.85);
  padding: 25px;
  border-radius: 15px;
  width: 280px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.feature:hover {
  transform: translateY(-10px);
}

.feature i {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: #1a2a6c;
}

.feature h3 {
  margin-bottom: 15px;
  color: #1a2a6c;
}

/* === FOOTER === */
.site-footer {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  margin-top: 40px;
  padding: 20px 20px 10px;
  color: white;
  width: 100%;
  box-sizing: border-box;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 15px;
}

.footer-col h3 {
  color: white;
  margin-bottom: 8px;
  font-size: 1rem;
}

.footer-col p {
  line-height: 1.4;
  opacity: 0.9;
  font-size: 0.85rem;
  margin-bottom: 5px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 5px;
}

.footer-links a {
  color: white;
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.3s ease;
  font-size: 0.85rem;
}

.footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.2);
  text-align: center;
  opacity: 0.8;
  font-size: 0.8rem;
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 20px 15px;
  }
  
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
  }
  
  .header-container {
    flex-direction: column;
    gap: 10px;
  }
  
  .header-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .modal-btn {
    min-width: 180px;
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  /* СКРЫВАЕМ САЙДБАРЫ НА МОБИЛЬНЫХ — ЭТО УБИРАЕТ ДУБЛИ ПОД ФУТЕРОМ */
  .sidebar-left,
  .sidebar-right {
    display: none;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .footer-container {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .site-footer {
    padding: 15px 10px 8px;
  }
  
  .banner-card img {
    width: 100%;
    height: auto;
  }
}

@media (max-width: 480px) {
  .buttons-container {
    flex-direction: column;
    align-items: center;
  }
  
  .modal-btn {
    width: 100%;
    max-width: 300px;
  }
}