/* ====== ОБЩИЕ СТИЛИ ====== */
html, body {
  margin: 0;
  padding: 0;
  font-family: "Baloo 2", cursive;
  color: #2E4E2E;
  background-color: #B0DA2A;
  background-image: url("/images/stars-bg.png");
  background-repeat: repeat;
  background-position: top left;
  background-size: auto;
  min-height: 100vh;
}

#wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px;
  box-sizing: border-box;
}

/* ==========================================================
   🧩 ОСНОВНОЙ LAYOUT СТРАНИЦ
   ========================================================== */

#main-flex {
  /* max-width: 1240px;  ← УДАЛИТЬ */
  margin: 20px auto;
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: stretch;
}


/* ==========================================================
   🧚 ШАПКА
   ========================================================== */
header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background-color: #B0DA2A;
  padding: 10px 20px;
  animation: headerFade 0.8s ease-out;
  z-index: 9999;
}

@keyframes headerFade {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Джин */
.block-genie {
  position: absolute;
  left: 80px;
  top: 10px;
  z-index: 11;
  opacity: 0;
  animation: genieFadeIn 1.5s ease-out forwards, genieFloat 3s ease-in-out infinite alternate;
}
.block-genie img {
  max-width: clamp(150px, 25vw, 200px);
  height: clamp(180px, 28vw, 270px);
  display: block;
}

@keyframes genieFadeIn {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes genieFloat {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

/* Тигр */
.block-tiger {
  position: absolute;
  right: 10px;
  top: 80px;
  z-index: 11;
  opacity: 0;
  animation: tigerFadeIn 1.5s ease-out forwards, tigerFloat 3s ease-in-out infinite alternate;
}
.block-tiger img {
  max-width: clamp(160px, 28vw, 220px);
  height: auto;
  display: block;
}
@keyframes tigerFadeIn {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes tigerFloat {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

/* Название */
.header-title {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.header-title .myImg {
  max-width: 600px;
  width: 100%;
  height: auto;
  margin-bottom: 5px;
}
header h1 {
  margin: 0;
  font-size: 50px;
  color: #2E4E2E;
  text-align: center;
}

/* ==========================================================
   🧭 ЛЕВАЯ КОЛОНКА — НАВИГАЦИЯ
   ========================================================== */
#leftside {
  flex: 0 0 260px;
  max-width: 260px;
  background-color: #E0F05C;
  border-radius: 10px;
  padding: 10px;
  box-sizing: border-box;
  text-align: center;
  font-size: 18px;
  line-height: 1.8;
}

#leftside .menu-item {
  display: block;
  border: 3px solid #66D174;
  border-radius: 50px;
  font-weight: bold;
  margin: 10px 0;
  padding: 10px 20px;
  text-decoration: none;
  color: #2E4E2E;
  transition: 0.3s;
}
#leftside .menu-item:hover {
  background-color: #66D174;
  color: #fff;
  transform: scale(1.05);
}
.menu-item.active {
  background-color: #a6e188;
  color: #1f361a;
  cursor: default;
}

/* ==========================================================
 ЦЕНТРАЛЬНЫЙ БЛОК — 
   ========================================================== */
/* Центральная колонка */
#content {
  flex: 1;
  max-width: 700px;
  background-color: #DBF95D;
  padding: 25px 30px;
  border-radius: 10px;
  box-sizing: border-box;
}


/* Контент текста */
#content2 {
  background: transparent;
  color: #2E4E2E;
  font-size: 18px;
  text-align: left;
  text-indent: 40px;
  line-height: 1.6;
  margin: 0;
}

h2 {
  text-align: center;
  
}

.games-hint {
  font-size: 20px;
  color: #4e72ae;
  opacity: 0.9;
}

/* ==========================================================
   🪄 ПРАВАЯ КОЛОНКА — РЕКЛАМА
   ========================================================== */
#rightside {
  flex: 0 0 260px;
  max-width: 260px;
  background-color: #E0F05C;
  border-radius: 10px;
  padding: 15px;
  box-sizing: border-box;
  text-align: center;
  overflow: hidden;
}
#rightside img {
  max-width: 100%;
  height: auto;
}


/* ==========================================================
   💬 ФУТЕР
   ========================================================== */
footer {
  text-align: center;
  background-color: #C6F55C;
  padding: 20px;
  color: #2E4E2E;
  font-size: 16px;
  border-top: 3px solid #A4D84E;
}
footer a {
  color: #4A0080;
  text-decoration: none;
  font-weight: bold;
}
footer a:hover {
  text-decoration: underline;
}

/* ==========================================================
   📱 Полная адаптация для телефонов — с меню и рекламой
   ========================================================== */

@media (max-width: 900px) {
 
#main-flex {
    flex-direction: column;
    align-items: center;
  }
  /* --- Навигация --- */
  #leftside {
    display: block !important;
    order: 1;
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
    background-color: #E0F05C;
    border-radius: 12px;
    padding: 10px;
    box-sizing: border-box;
  }

  /* --- Контент --- */
  #content {
    order: 2;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 20px;
    background-color: #DBF95D;
    border-radius: 12px;
  }

  /* --- Реклама --- */
  .right-column,
  #rightside,
  #ads {
    display: block !important;
    order: 3;
    width: 100%;
    max-width: 100%;
    background-color: #E0F05C;
    border-radius: 12px;
    padding: 10px;
    margin: 0 auto 20px;
    text-align: center;
    overflow: visible !important;
  }

  #ads img,
  .block-genie-abss img {
    display: block;
    max-width: 120px;
    height: auto;
    margin: 10px auto;
  }

  #ads h3 {
    font-size: 18px;
    margin-bottom: 5px;
  }

  #ad-text {
    font-size: 16px;
    line-height: 1.4;
  }
}

/* ==========================================================
   💬 Для самых маленьких экранов (телефоны)
   ========================================================== */
@media (max-width: 480px) {
  header h1 {
    font-size: 26px;
  }

  .header-title .myImg {
    max-width: 200px;
  }

  #ads img,
  .block-genie-abss img {
    max-width: 100px;
  }
}

/* ===========================================
   🧚 Исправление шапки на телефонах
   =========================================== */
@media (max-width: 600px) {
  header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    gap: 8px; /* немного воздуха между элементами */
    position: relative;
  }

  /* джин и тигр становятся меньше и встают один под другим */
  .block-genie,
  .block-tiger {
    position: static;
    display: block;
    opacity: 1 !important;
    animation: none;
    margin: 4px auto;
  }

  .block-genie img,
  .block-tiger img {
    width: 90px;
    height: auto;
  }

  /* логотип и надпись по центру */
  .header-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .header-title .myImg {
    max-width: 220px;
    height: auto;
    margin: 5px auto;
  }

  header h1 {
    font-size: 28px;
    margin: 5px 0;
  }
}

/* 🎬 Video Stories — как Cartoons */

.cartoons-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 30px;
}

.cartoon-item {
  text-align: center;
  width: 320px;
  margin: 0 auto 30px;
}

.cartoon-thumb {
  width: 100%;
  max-width: 320px;
  border-radius: 14px;
  cursor: pointer;
  display: block;
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cartoon-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 26px rgba(0,0,0,0.15);
}

/* 📱 Мобилки */
@media (max-width: 480px) {
  .cartoon-item {
    width: 100%;
  }

  .cartoon-thumb {
    max-width: 235px;
    margin: 0 auto;
  }
}

