/* Общие стили */
.btn-telegram {
  background: #0088cc;
  color: white;
}
.btn-whatsapp {
  background: #25d366;
  color: white;
}
.btn-telegram:hover,
.btn-whatsapp:hover {
  opacity: 0.9;
}
.explanation {
  display: none; /* Скрываем изначально */
  margin-top: 25px;
  padding: 20px;
  background: #fff8e1;
  border-radius: 12px;
  line-height: 1.7;
  text-align: left;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f9fc;
  color: #333;
  line-height: 1.6;
}

.container {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  gap: 20px;
}

.main-content {
  flex: 1;
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Header */
header {
  background: #004d40;
  color: white;
  padding: 15px 0;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

header h1 {
  font-size: 28px;
  letter-spacing: 1px;
}

/* Sidebar */
  .container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
  }

  .main-content {
    flex: 1;
    min-width: 300px; /* чтобы не сжималось слишком сильно */
  }

  .sidebar {
    width: 300px; /* фиксированная ширина сайдбара */
    background: #fafafa;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  }

  /* Адаптивность: на мобильных сайдбар под контентом */
  @media (max-width: 768px) {
    .container {
      flex-direction: column;
    }
    .sidebar {
      width: 100%;
    }
  }

  /* Стили игры (если ещё не заданы) */
  .game {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0;
  }
  .bank {
    width: 30%;
    min-height: 200px;
    padding: 10px;
    background: #e9f5e0;
    border-radius: 8px;
    text-align: center;
  }
  .river {
    width: 30%;
    position: relative;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .boat {
    font-size: 24px;
    transition: transform 0.5s ease;
  }
  .character {
    display: inline-block;
    margin: 5px;
    font-size: 24px;
    cursor: pointer;
    user-select: none;
  }
  .message {
    margin: 15px 0;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
  }
  .message.error { background: #ffe6e6; color: #d32f2f; }
  .message.success { background: #e6ffe6; color: #2e7d32; }
  .reset-btn {
    padding: 10px 20px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
  }
  .reset-btn:hover { background: #45a049; }
  
/* Footer */
footer {
  background: #004d40;
  color: white;
  text-align: center;
  padding: 25px 0;
  margin-top: 40px;
}

footer h3 {
  margin-bottom: 15px;
  font-size: 20px;
}

.footer-menu {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  list-style: none;
}

.footer-menu a {
  color: #a7ffeb;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.footer-menu a:hover {
  color: white;
  text-decoration: underline;
}

/* Стили игры (перенесены из предыдущего кода) */
.game {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px auto;
  width: 100%;
  max-width: 800px;
}
.bank {
  width: 35%;
  background: #c8e6c9;
  padding: 20px;
  border-radius: 10px;
  min-height: 200px;
}
.river {
  width: 20%;
  background: #4fc3f7;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}
.boat {
  width: 60px;
  height: 40px;
  background: #5d4037;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  margin-top: 10px;
  cursor: pointer;
}
.character {
  display: inline-block;
  width: 50px;
  height: 50px;
  margin: 5px;
  border-radius: 50%;
  line-height: 50px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}
.farmer { background: #ff9800; color: white; }
.wolf { background: #757575; color: white; }
.goat { background: #8bc34a; color: white; }
.cabbage { background: #4caf50; color: white; }

.message {
  margin-top: 20px;
  font-size: 18px;
  font-weight: bold;
  min-height: 24px;
}
.error { color: #d32f2f; }
.success { color: #388e3c; }
.reset-btn {
  margin-top: 20px;
  padding: 10px 20px;
  font-size: 16px;
  background: #00796b;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
.reset-btn:hover {
  background: #004d40;
}

/* Адаптивность */
@media (max-width: 1100px) {
  .container {
    flex-direction: column;
    align-items: center;
  }
  .sidebar {
    width: 100%;
    max-width: 320px;
    position: static;
  }
}