@font-face { font-family: "Minecraft rus"; src: url("/font/minecraft.ttf"); }
@font-face { font-family: "HomeVideo"; src: url("/font/HomeVideo-Regular.otf"); }
@font-face { font-family: "Comic sans ms pixel"; src: url("/font/comic_sans_ms_pixel_rus_eng.ttf"); }
@font-face { font-family: "pfDinText"; src: url("/font/PFDinTextPro-Bold.otf"); }

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #090612;
  margin: 0;
  padding: 0;
}

/* Основной контент */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.base {
  font-family: "pfDinText";
  min-height: calc(100vh - 80px);
  color: #d6d2e0;
  padding: 70px 3vw 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 0 auto; /* Важно: flex-grow: 1, flex-shrink: 0, flex-basis: auto */
  width: 100%; /* Добавляем ширину 100% */
}

.base-container {
  max-width: 800px;
}

.base h1 {
  text-align: center;
  font-size: clamp(32px, 5vw, 46px);
  margin-bottom: 1vh;
  letter-spacing: 1.2px;
}

.base p {
  text-align: center;
  font-size: clamp(16px, 2.5vw, 20px);
  letter-spacing: 0.5px;
  margin-bottom: 1vh;
}

.p1 {
  color: #dd665e;
}

/* Шапка */
.cap {
  height: 60px;
  user-select: none;
  position: fixed;
  background-color: #090612;
  top: 0;
  width: 100%;
  transition: all 0.3s ease-in-out;
  z-index: 1000;
  border-bottom: 2px solid;
  border-image: linear-gradient(45deg, #94eaff, #247083) 1;
}

.cap-container {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1vh 2%;
  max-width: 1200px;
  margin: 0 auto;
  transition: all 0.3s ease-in-out;
}

/* Логотип */
.logo-link {
  text-decoration: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.logo {
  color: #418ea1;
  font-family: "Minecraft rus";
  font-size: clamp(24px, 3.7vh, 40px);
  white-space: nowrap;
}

.logo-link:hover .logo {
  color: #69bace;
}

/* Мобильное меню */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: #dcdcdc;
  margin: 3px 0;
  transition: 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

.urla {
  display: flex;
  list-style: none;
  gap: 15px;
}

.urla a {
  color: #dcdcdc;
  font-family: "HomeVideo";
  font-size: clamp(16px, 3.4vh, 32px);
  font-weight: bold;
  text-decoration: none;
  padding: 8px 12px;
  transition: color 0.3s ease;
}

.urla a:hover,
.urla a.buse {
  color: #83c5be;
}

/* Подсказки */
.tooltip-container {
  font-family: "Comic sans ms pixel";
  position: relative;
  display: flex;
  cursor: pointer;
}

.tooltip-text {
  font-family: "pfDinText";
  visibility: hidden;
  background-color: #2c2c2cd8;
  color: #fff;
  text-align: center;
  border-radius: 5px;
  padding: 8px 12px;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
  font-size: 14px;
}

.tooltip-text::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent #2c2c2cd8 transparent;
}

.tooltip-container:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Подвал */
.footer {
  font-family: "Comic sans ms pixel";
  background-color: #090612;
  color: #dcdcdc;
  border-top: 2px solid;
  border-image: linear-gradient(45deg, #94eaff, #247083) 1;
  width: 100%;
  flex-shrink: 0; /* Важно: не сжимается */
  margin-top: auto; /* Прижимается к низу */
}

.fot {
  padding: 10px;
  width: 100%;
  text-align: center;
  margin: 0;
}

/* Адаптивность */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }
  .urla {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    flex-direction: column;
    background-color: #090612ad;
    padding: 20px;
    gap: 0;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-bottom: 2px solid;
    border-image: linear-gradient(45deg, #94eaff, #247083) 1;
  }
  .urla.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .urla .tooltip-container {
    width: 100%;
    justify-content: center;
    margin: 8px 0;
  }
  .tooltip-text {
    display: none;
  }
  .cap-container {
    padding: 1vh 4%;
  }
  .base.game-base {
    padding-top: 130px;
    padding-bottom: 70px;
  }
}

@media (max-width: 600px) {
  .logo {
    font-size: clamp(28px, 2.5vh, 30px);
  }
  .cap-container {
    padding: 0.5vh 3%;
  }
  .base h1 {
    font-size: 28px;
  }
  .base p {
    font-size: 16px;
  }
}

/* Стиль для активной ссылки в меню */
.urla a.active {
  color: #83c5be;
  position: relative;
}

.urla a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(45deg, #94eaff, #247083);
}

/* Анимация загрузки */
#header, #footer {
  opacity: 0;
  transition: opacity 0.3s ease;
}

#header.loaded, #footer.loaded {
  opacity: 1;
}

.social-h1 {
  color: #f4efff;
  font-family: "pfDinText";
  font-size: clamp(13px, 2.9vw, 20px);
  margin-bottom: 0.5vw;
  letter-spacing: 1.15px;
}

.social-p {
  color: #d6d2e0;
  font-family: "pfDinText";
  font-size: clamp(9px, 2.9vw, 16px);
  letter-spacing: 0.5px;
}

.social-links {
  margin-top: 1vh;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.social-item {
  text-decoration: none;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 17px;
  padding: 15px 20px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-item:hover {
  background: #524b63;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(184, 209, 255, 0.2);
}

.social-icon {
  user-select: none;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 22px;
  margin-right: 20px;
  flex-shrink: 0;
}

/* Адаптивность социальных ссылок */
@media (max-width: 600px) {
  .social-item {
    padding: 12px 15px;
  }
  .social-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
    margin-right: 15px;
  }
  .social-name {
    font-size: 16px;
  }
  .social-desc {
    font-size: 13px;
  }
  .social {
    width: 40px;
    height: 40px;
    margin-right: 10px;
  }
}

.social-link {
  user-select: none;
  text-align: center;
  margin-bottom: 1vw;
}

.social {
  display: inline-block;
  position: relative;
  cursor: pointer;
}

.social a {
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 10px 10px 0;
  text-align: center;
  color: #fff;
  border-radius: 24px;
  transition: 0.3s;
}

.social a:hover {
  border-color: #524b63;
  opacity: .5;
  transform: translateY(-2px);
}

/* Контейнер игры */
#game-container {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  font-family: "pfDinText";
  width: 100%; /* Убедимся, что контейнер занимает всю ширину */
  padding-bottom: 20px; /* Добавляем отступ снизу */
}

/* Игровое поле */
#board {
  margin: 20px auto 30px; /* Центрируем и добавляем отступы */
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  background-color: #16698f;
  padding: 5px;
  border-radius: 10px;
}

.cell {
  width: 70px;
  height: 70px;
  background-color: #DFE1E0;
  border-radius: 50%;
  position: relative;
  transition: background-color 0.2s;
}

.disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
}

.animate-drop {
  animation: drop 0.5s ease-in;
}

.red {
  background-color: #e2655c;
}

.yellow {
  background-color: #fac960;
}

.column-hover {
  background-color: #B4C6D0;
}

.cell-hover-red {
  background-color: #cfa4a4;
}

.cell-hover-yellow {
  background-color: #d6cd9c;
}

@keyframes drop {
  from { transform: translateY(-500px); }
  to { transform: translateY(0); }
}

#status {
  font-size: 20px;
  margin: 20px;
  color: #d6d2e0;
}

#room-form {
  margin: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

#room-form input,
#room-form button,
#room-form select {
  padding: 10px;
  font-size: 16px;
  font-family: "pfDinText";
  border-radius: 5px;
  border: 1px solid #418ea1;
  background-color: #2c2c2cd8;
  color: #d6d2e0;
  transition: background-color 0.3s, transform 0.3s;
}

#room-form button:hover,
#room-form select:hover {
  background-color: #524b63;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  #board {
    gap: 3px;
    padding: 5px;
  }
  .cell {
    width: 60px;
    height: 60px;
  }
  #room-form input,
  #room-form button,
  #room-form select {
    padding: 8px;
    font-size: 14px;
  }
}

@media (max-width: 600px) {
  #board {
    gap: 3px;
    padding: 5px;
  }
  .cell {
    width: 50px;
    height: 50px;
  }
  #room-form input,
  #room-form button,
  #room-form select {
    padding: 8px;
    font-size: 14px;
  }
}

@media (max-width: 380px) {
  #board {
    gap: 3px;
    padding: 5px;
  }
  .cell {
    width: 40px;
    height: 40px;
  }
  #room-form input,
  #room-form button,
  #room-form select {
    padding: 8px;
    font-size: 14px;
  }
}

/* Анимация победы */
.win-highlight {
  animation: win-pulse 1s infinite;
}

@keyframes win-pulse {
  0% { box-shadow: 0 0 0 rgba(0, 255, 179, 0.77); }
  50% { box-shadow: 0 0 20px rgba(0, 255, 179, 0.77); }
  100% { box-shadow: 0 0 0 rgba(0, 255, 179, 0.77); }
}