@font-face { font-family: "Minecraft rus"; src: url("/font/minecraft.ttf"); }
@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/Nebulas-Bold.ttf"); }

* {
  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;
  width: 100%;
}
.base-container {
  max-width: 800px;
  width: 100%;
  padding: 0 10px;
}
.base h1 {
  color: #f4efff;
  text-align: center;
  font-size: clamp(32px, 5vw, 46px);
  margin-bottom: 1vh;
  letter-spacing: 1.2px;
  line-height: 1.2;
}
.base h2 {
  color: #f4efff;
  margin-top: 3vh;
  text-align: center;
  font-size: clamp(26px, 4vw, 30px);
  margin-bottom: 1vh;
  letter-spacing: 1.2px;
}
.base p {
  margin: 0 auto 2vh;
  text-align: center;
  font-size: clamp(16px, 2.5vw, 20px);
  letter-spacing: 0.5px;
  line-height: 1.6;
  overflow-wrap: break-word;
}
.base a {
  color: #9ee7ff;
}
.red-p {
  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, #9ee7ff, #00C0fe) 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: #00C0fe;
  font-family: "Minecraft rus";
  font-size: clamp(24px, 3.7vh, 40px);
  white-space: nowrap;
}
.logo-link:hover .logo {
  color: #9ee7ff;
}

/* Мобильное меню */
.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: "Comic sans ms pixel";
  font-size: clamp(36px, 3.4vh, 48px);
  text-decoration: none;
  padding: 8px 12px;
  transition: color 0.3s ease;
}
.urla a:hover,
.urla a.buse {
  color: #9ee7ff;
}

/* Подсказки */
.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, #9ee7ff, #00C0fe) 1;
  width: 100%;
  flex-shrink: 0;
  margin-top: auto;
}
.fot {
  padding: 10px;
  width: 100%;
  text-align: center;
}
.footer a {
  color: #9ee7ff;
}

/* Адаптивность */
@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: 3px;
    gap: 0;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-bottom: 2px solid;
    border-image: linear-gradient(45deg, #9ee7ff, #00C0fe) 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 {
    padding: 70px 15px 30px;
  }
  .base h1 {
    font-size: 28px;
  }
  .base p {
    font-size: 16px;
  }
  .social-links {
    padding: 0 5px;
  }
}

/* Стиль для активной ссылки в меню */
.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;
}

/* ===== Переменные социальных блоков ===== */
:root {
  --social-accent: #9ee7ff;
  --social-accent-deep: #00C0fe;
  --social-bg: rgba(255, 255, 255, 0.08);
  --social-bg-hover: rgba(158, 231, 255, 0.12);
  --social-border: rgba(158, 231, 255, 0.25);
  --social-border-hover: #9ee7ff;
  --social-shadow: rgba(0, 192, 254, 0.2);
  --social-text: #f4efff;
  --social-text-muted: #d6d2e0;
  --social-label: #b8b3c7;
  --social-radius-card: 17px;
  --social-radius-icon: 12px;
  --social-radius-round: 50%;
}

/* Текстовые элементы */
.social-h1 {
  color: var(--social-text);
  font-family: "pfDinText";
  font-size: clamp(14px, 2.9vw, 20px);
  margin-bottom: 0.5vw;
  letter-spacing: 1.15px;
  overflow-wrap: break-word;
}
.social-p {
  color: var(--social-text-muted);
  font-family: "pfDinText";
  font-size: clamp(13px, 2.9vw, 16px);
  letter-spacing: 0.5px;
  overflow-wrap: break-word;
}

/* Карточки социальных ссылок */
.social-links {
  margin-top: 1vh;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.social-item {
  text-decoration: none;
  display: flex;
  align-items: center;
  background: var(--social-bg);
  border-radius: var(--social-radius-card);
  padding: 15px 20px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid var(--social-border);
  position: relative;
  overflow: hidden;
}
.social-item > div:last-child {
  min-width: 0;
}
.social-item::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(circle at 30% 50%, rgba(0, 192, 254, 0.12) 0%, transparent 70%);
  pointer-events: none;
}
.social-item:hover {
  background: var(--social-bg-hover);
  border-color: var(--social-border-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px var(--social-shadow);
}
.social-item:hover::before {
  opacity: 1;
}

/* Иконки внутри карточек */
.social-icon {
  user-select: none;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--social-radius-icon);
  font-size: 22px;
  margin-right: 20px;
  flex-shrink: 0;
  padding: 5px;
  transition: all 0.3s ease;
}
.social-item:hover .social-icon {
  border-color: rgba(158, 231, 255, 0.4);
  transform: scale(1.05);
}
.social-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Круглые иконки (верхний ряд) */
.social-link {
  user-select: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 1vw;
  padding: 5px;
}
.social {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: var(--social-radius-round);
  background: var(--social-bg);
  border: 2px solid var(--social-border);
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;
  position: relative;
}
.social a::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--social-radius-round);
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(circle, rgba(0, 192, 254, 0.15) 0%, transparent 70%);
}
.social a:hover {
  background: var(--social-bg-hover);
  border-color: var(--social-border-hover);
  transform: translateY(-5px);
  box-shadow: 0 10px 25px var(--social-shadow);
}
.social a:hover::before {
  opacity: 1;
}
.social a img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  pointer-events: none;
  position: relative;
  z-index: 1;
}
.social .tooltip-text {
  margin-top: 6px;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
}

/* Адаптивность социальных ссылок */
@media (max-width: 600px) {
  .social-link {
    gap: 12px;
  }
  .social {
    gap: 6px;
  }
  .social a {
    width: 56px;
    height: 56px;
  }
  .social .tooltip-text {
    display: none;
  }
  .social-item {
    padding: 12px 15px;
  }
  .social-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
    margin-right: 15px;
  }
}


/* 4 в ряд */
/* Контейнер игры */
#game-container {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  font-family: "pfDinText";
  width: 100%;
  padding-bottom: 20px;
}

/* Игровое поле */
#board {
  margin: 20px auto;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: clamp(2px, 0.8vw, 4px);
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(158, 231, 255, 0.15);
  padding: clamp(4px, 1.5vw, 8px);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 560px;
}

.cell {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #090612;
  border-radius: 50%;
  position: relative;
  transition: background-color 0.2s, box-shadow 0.2s;
  border: 1px solid rgba(158, 231, 255, 0.08);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.25), 0 4px 10px rgba(0, 0, 0, 0.4);
}

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

.red {
  background-color: #e2655c;
  box-shadow: 0 0 14px rgba(226, 101, 92, 0.55), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.yellow {
  background-color: #fac960;
  box-shadow: 0 0 14px rgba(250, 201, 96, 0.55), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.column-hover {
  background-color: rgba(158, 231, 255, 0.12);
  box-shadow: inset 0 0 12px rgba(158, 231, 255, 0.15);
}

.cell-hover-red {
  background-color: rgba(226, 101, 92, 0.22);
  border-color: rgba(226, 101, 92, 0.4);
}

.cell-hover-yellow {
  background-color: rgba(250, 201, 96, 0.22);
  border-color: rgba(250, 201, 96, 0.4);
}

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

#status {
  text-align: center;
  font-size: clamp(18px, 2.5vw, 22px);
  letter-spacing: 0.5px;
  margin-bottom: 1vh;
  color: #f4efff;
  min-height: 1.5em;
}

/* Форма управления */
#room-form {
  margin: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

#room-form input,
#room-form button,
#room-form select {
  text-align: center;
  padding: 10px 16px;
  font-size: 16px;
  font-family: "pfDinText";
  border-radius: 10px;
  border: 1px solid rgba(158, 231, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: #d6d2e0;
  transition: all 0.3s ease;
  cursor: pointer;
  outline: none;
}

#room-form select {
  background: rgba(255, 255, 255, 0.06);
  color: #d6d2e0;
}

#room-form select option {
  background: #12101a;
  color: #d6d2e0;
  padding: 8px;
}

#collapse-header {
  justify-content: center;
  text-align: center;
}

.collapse-header {
  color: #f4efff;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid;
  border-image: linear-gradient(45deg, #9ee7ff, #00C0fe) 1;
  transition: background-color 0.3s;
  cursor: pointer;
}
.collapse-title {
  user-select: none;
  font-family: "pfDinText";
  font-size: clamp(15px, 2.9vw, 20px);
  letter-spacing: 0.6px;
  flex: 1;
  text-align: center;
}
.collapse-indicator {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #d6d2e0;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 10px;
}

#room-form select option {
  background: #12101a;
  color: #d6d2e0;
}

#room-form select option {
  background: #12101a;
  color: #d6d2e0;
}

#room-form input::placeholder {
  color: #7a7585;
}

#room-form button:hover,
#room-form select:hover,
#room-form input:hover {
  background: rgba(158, 231, 255, 0.12);
  border-color: #9ee7ff;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 192, 254, 0.15);
}

/* Кастомный выбор сложности */
.difficulty-dropdown {
  position: relative;
  display: inline-block;
}
.difficulty-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 16px;
  font-family: "pfDinText";
  border-radius: 10px;
  border: 1px solid rgba(158, 231, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: #d6d2e0;
  transition: all 0.3s ease;
  cursor: pointer;
  outline: none;
  min-width: 140px;
}
.difficulty-toggle:hover {
  background: rgba(158, 231, 255, 0.12);
  border-color: #9ee7ff;
  box-shadow: 0 5px 15px rgba(0, 192, 254, 0.15);
}
.difficulty-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #9ee7ff;
  transition: transform 0.3s ease;
}
.difficulty-dropdown.open .difficulty-arrow {
  transform: rotate(180deg);
}
.difficulty-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #12101a;
  border: 1px solid rgba(158, 231, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s ease;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.difficulty-dropdown.open .difficulty-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.difficulty-option {
  padding: 10px 14px;
  font-family: "pfDinText";
  font-size: 15px;
  color: #d6d2e0;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  border-bottom: 1px solid rgba(158, 231, 255, 0.06);
}
.difficulty-option:last-child {
  border-bottom: none;
}
.difficulty-option:hover {
  background: rgba(158, 231, 255, 0.1);
  color: #9ee7ff;
}
.difficulty-option.active {
  background: rgba(0, 192, 254, 0.15);
  color: #9ee7ff;
}

#room-form button:active {
  transform: translateY(0);
}

/* Кнопка после окончания игры */
#game-over-controls {
  margin: 12px auto;
  text-align: center;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
#play-again-btn {
  padding: 14px 36px;
  font-size: 18px;
  font-family: "pfDinText";
  border-radius: 12px;
  border: 2px solid #9ee7ff;
  background: rgba(0, 192, 254, 0.12);
  color: #9ee7ff;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.8px;
}
#play-again-btn:hover {
  background: rgba(0, 192, 254, 0.25);
  box-shadow: 0 0 25px rgba(0, 192, 254, 0.35);
  transform: translateY(-3px);
}
#play-again-btn:active {
  transform: translateY(0);
}
#swap-colors-btn {
  padding: 14px 36px;
  font-size: 18px;
  font-family: "pfDinText";
  border-radius: 12px;
  border: 2px solid #fac960;
  background: rgba(250, 201, 96, 0.12);
  color: #fac960;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.8px;
}
#swap-colors-btn:hover {
  background: rgba(250, 201, 96, 0.25);
  box-shadow: 0 0 25px rgba(250, 201, 96, 0.35);
  transform: translateY(-3px);
}
#swap-colors-btn:active {
  transform: translateY(0);
}

/* Список комнат */
#room-list-container {
  display: none;
  width: 100%;
  margin-top: 15px;
}

/* Ручной ввод */
#manual-join {
  display: none;
  width: 100%;
  margin-top: 15px;
}

/* Список комнат */
#room-list-container {
  display: none;
  width: 100%;
  margin-top: 15px;
}

/* Ручной ввод */
#manual-join {
  display: none;
  width: 100%;
  margin-top: 15px;
}

/* Группы кнопок интерфейса */
.game-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.3s ease, max-height 0.35s ease, margin 0.3s ease;
  max-height: 200px;
  opacity: 1;
  overflow: hidden;
}
.game-menu.hidden {
  max-height: 0;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}

.game-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.3s ease, max-height 0.35s ease;
  max-height: 60px;
  opacity: 1;
  overflow: hidden;
}
.game-controls.hidden {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

/* Список комнат */
.room-list-container {
  width: 100%;
  margin-top: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.35s ease;
}
.room-list-container.open {
  margin-top: 15px;
  max-height: 600px;
  opacity: 1;
}

.room-list-container h3 {
  color: #f4efff;
  margin-bottom: 10px;
  font-family: "pfDinText";
  font-size: clamp(16px, 2.5vw, 20px);
  letter-spacing: 0.5px;
}

#room-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(158, 231, 255, 0.1);
  border-radius: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(158, 231, 255, 0.3) rgba(255, 255, 255, 0.05);
}

.room-list-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  vertical-align: middle;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #9ee7ff;
  transition: transform 0.3s ease;
}

.room-list-arrow.open {
  transform: rotate(180deg);
}
#room-list::-webkit-scrollbar {
  width: 8px;
}
#room-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}
#room-list::-webkit-scrollbar-thumb {
  background: rgba(158, 231, 255, 0.3);
  border-radius: 4px;
}
#room-list::-webkit-scrollbar-thumb:hover {
  background: rgba(158, 231, 255, 0.5);
}

.room-item {
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(158, 231, 255, 0.15);
  border-radius: 10px;
  cursor: not-allowed;
  transition: all 0.3s ease;
  text-align: left;
}

.room-item.waiting {
  background: rgba(0, 192, 254, 0.08);
  border-color: rgba(0, 192, 254, 0.3);
  cursor: pointer;
}

.room-item.waiting:hover {
  background: rgba(0, 192, 254, 0.15);
  border-color: #9ee7ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 192, 254, 0.2);
}

.room-item.full {
  background: rgba(226, 101, 92, 0.08);
  border-color: rgba(226, 101, 92, 0.3);
}

.room-item .room-id {
  font-weight: bold;
  color: #f4efff;
  margin-bottom: 5px;
  font-family: "pfDinText";
  letter-spacing: 0.5px;
}

.room-item .room-meta {
  font-size: 14px;
  color: #d6d2e0;
  font-family: "pfDinText";
}

.room-item .room-status {
  font-size: 14px;
  font-family: "pfDinText";
  margin-top: 2px;
}

.room-item .room-status.waiting {
  color: #9ee7ff;
}

.room-item .room-status.full {
  color: #e2655c;
}

.room-list-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
#room-list-status {
  font-size: 14px;
  color: #d6d2e0;
  font-family: "pfDinText";
}

#room-list-status {
  font-size: 14px;
  color: #d6d2e0;
  font-family: "pfDinText";
}

/* Ручной ввод */
.manual-join {
  width: 100%;
  margin-top: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.35s ease;
}
.manual-join.open {
  margin-top: 15px;
  max-height: 200px;
  opacity: 1;
}

#manual-join .join-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

#room-id {
  flex: 1;
  max-width: 220px;
}

/* Блок поделиться ссылкой */
#share-link-container {
  width: 100%;
  max-width: 460px;
  margin: 12px auto;
}
.share-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
#share-link {
  flex: 1;
  text-align: center;
  padding: 10px 14px;
  font-size: 14px;
  font-family: "pfDinText";
  border-radius: 10px;
  border: 1px solid rgba(158, 231, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: #d6d2e0;
  cursor: text;
  outline: none;
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
}
#share-link:focus {
  border-color: #9ee7ff;
  background: rgba(158, 231, 255, 0.08);
}
#share-link::selection {
  background: rgba(0, 192, 254, 0.3);
  color: #f4efff;
}
#copy-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: "pfDinText";
  border-radius: 10px;
  border: 1px solid rgba(158, 231, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: #d6d2e0;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}
#copy-btn:hover {
  background: rgba(158, 231, 255, 0.12);
  border-color: #9ee7ff;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 192, 254, 0.15);
}
#copy-btn:active {
  transform: translateY(0);
}
#copy-btn svg {
  width: 18px;
  height: 18px;
  stroke: #9ee7ff;
}
.copy-toast {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #2c2c2cd8;
  color: #fff;
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 13px;
  font-family: "pfDinText";
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  pointer-events: none;
  z-index: 10;
}
.copy-toast::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent #2c2c2cd8 transparent;
}
.copy-toast.show {
  opacity: 1;
  visibility: visible;
}

/* Бейдж цвета игрока */
.player-color-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px auto 12px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(158, 231, 255, 0.2);
  border-radius: 20px;
  font-family: "pfDinText";
  font-size: clamp(14px, 2vw, 16px);
  color: #f4efff;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.player-color-badge.hidden {
  display: none;
}
.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}
.color-dot.red {
  background: #e2655c;
  color: #e2655c;
}
.color-dot.yellow {
  background: #fac960;
  color: #fac960;
}

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

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Адаптивность игры */
@media (max-width: 768px) {
  #room-form {
    gap: 6px;
    margin: 15px 10px;
  }
  #room-form input,
  #room-form button,
  #room-form select {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 8px;
  }
  #play-again-btn {
    padding: 12px 28px;
    font-size: 16px;
  }
  #swap-colors-btn {
    padding: 12px 28px;
    font-size: 16px;
  }
  #room-list {
    grid-template-columns: 1fr;
    max-height: 240px;
  }
  .room-item {
    padding: 10px;
  }
  .player-color-badge {
    margin: 10px auto;
    padding: 8px 14px;
    font-size: 14px;
  }
  .share-row {
    flex-direction: column;
  }
  #share-link {
    width: 100%;
    font-size: 13px;
    padding: 8px 10px;
  }
  #copy-btn {
    width: 100%;
    padding: 8px 12px;
  }
}

@media (max-width: 600px) {
  #game-container {
    padding: 0 10px 20px;
  }
  #play-again-btn {
    padding: 10px 24px;
    font-size: 15px;
  }
}

@media (max-width: 380px) {
  #room-form input,
  #room-form button,
  #room-form select {
    font-size: 13px;
    padding: 8px 10px;
  }
  #play-again-btn {
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* Cворачивающейся блок */
.collapse-block {
  margin: 1vh;
}
.collapse-header {
  color: #f4efff;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid;
  border-image: linear-gradient(45deg, #9ee7ff, #00C0fe) 1;
  transition: background-color 0.3s;
}
.collapse-header:hover {
  color: #9ee7ff;
}
.collapse-title {
  user-select: none;
  font-family: "pfDinText";
  font-size: clamp(15px, 2.9vw, 20px);
  letter-spacing: 0.6px;
}
.collapse-indicator {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #d6d2e0;
  transition: transform 0.3s ease;
}
.collapse-indicator.open {
  transform: rotate(180deg);
}
.collapse-content {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.collapse-content.open {
  padding: 16px;
  max-height: 2000px;
  background: #0d0a14;
  border-top: 1px solid rgba(158, 231, 255, 0.1);
}
.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1vh;
}
@media (min-width: 768px) {
  .content-wrapper {
    flex-direction: row;
    align-items: flex-start;
  }
}
.block-image {
  flex-shrink: 0;
  width: 100%;
  max-width: 300px;
  border-radius: 6px;
  overflow: hidden;
}
@media (min-width: 768px) {
  .block-image {
    width: 300px;
  }
}
.block-image img {
  width: 100%;
  height: auto;
  display: block;
}
.text-p p {
  margin: 1.4vh;
  text-align: justify;
}
.block-text {
  flex: 1;
}
.block-text a {
  color: #f4efff;
}
.block-text p {
  text-align: left;
  font-family: "pfDinText";
  font-size: clamp(14px, 2.5vw, 16px);
  margin-bottom: 15px;
  letter-spacing: 0.5px;
}
.download-links {
  margin: 1vh;
  user-select: none;
}
.download-link {
  text-decoration: none;
  text-align: center;
  padding: 10px;
  font-size: 16px;
  font-family: "pfDinText";
  border-radius: 5px;
  border: 1px solid #00C0fe;
  background-color: #2c2c2cd8;
  color: #d6d2e0;
  transition: background-color 0.3s, transform 0.3s;
}
.download-link:hover {
  background-color: #524b63;
  transform: translateY(-2px);
}
.download-link i {
  margin-right: 8px;
}

/* ===== ТЕТРИС ===== */
.tetris-container {
  max-width: 1400px;
  width: 100%;
}
.tetris-container h1 {
  margin-bottom: 20px;
}

.tetris-layout {
  display: grid;
  grid-template-columns: 300px auto 300px;
  gap: 24px;
  align-items: start;
  justify-content: center;
}

.tetris-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(158, 231, 255, 0.15);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tetris-section h3 {
  color: #f4efff;
  font-family: "pfDinText";
  font-size: 18px;
  margin-bottom: 10px;
  text-align: center;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(158, 231, 255, 0.2);
  padding-bottom: 6px;
}

.tetris-controls-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tetris-controls-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d6d2e0;
  font-family: "pfDinText";
  font-size: 14px;
}
.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 4px 8px;
  background: rgba(158, 231, 255, 0.1);
  border: 1px solid rgba(158, 231, 255, 0.3);
  border-radius: 6px;
  color: #9ee7ff;
  font-family: "pfDinText";
  font-size: 13px;
  text-align: center;
}

.tetris-rules {
  color: #d6d2e0;
  font-family: "pfDinText";
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}

.tetris-btn {
  font-family: "pfDinText";
  padding: 10px 16px;
  font-size: 15px;
  border-radius: 10px;
  border: 1px solid rgba(158, 231, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: #d6d2e0;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}
.tetris-btn:hover:not(:disabled) {
  background: rgba(158, 231, 255, 0.12);
  border-color: #9ee7ff;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 192, 254, 0.15);
}
.tetris-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.tetris-btn-primary {
  border: 2px solid #9ee7ff;
  background: rgba(0, 192, 254, 0.12);
  color: #9ee7ff;
}
.tetris-btn-primary:hover:not(:disabled) {
  background: rgba(0, 192, 254, 0.25);
  box-shadow: 0 0 25px rgba(0, 192, 254, 0.35);
}
.tetris-btn-small {
  padding: 6px 10px;
  font-size: 13px;
}

.tetris-center {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

#tetris-canvas {
  background: #090612;
  border: 2px solid rgba(158, 231, 255, 0.25);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  max-width: 100%;
  height: auto;
}

.tetris-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(9, 6, 18, 0.85);
  border-radius: 8px;
  z-index: 10;
}
.tetris-overlay.hidden,
.hidden {
  display: none !important;
}

.tetris-overlay-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tetris-overlay-content h2 {
  color: #f4efff;
  font-family: "pfDinText";
  font-size: 28px;
}

.tetris-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(158, 231, 255, 0.08);
}
.tetris-stat-label {
  color: #b8b3c7;
  font-family: "pfDinText";
  font-size: 14px;
}
.tetris-stat-value {
  color: #9ee7ff;
  font-family: "pfDinText";
  font-size: 16px;
  font-weight: bold;
}

#tetris-next,
#tetris-hold {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(158, 231, 255, 0.1);
  image-rendering: pixelated;
}

.tetris-leaderboard {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: rank;
}
.tetris-leaderboard li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
  font-family: "pfDinText";
  font-size: 14px;
  color: #d6d2e0;
}
.tetris-leaderboard li:nth-child(1) {
  background: rgba(250, 201, 96, 0.12);
  border: 1px solid rgba(250, 201, 96, 0.3);
  color: #fac960;
}
.tetris-leaderboard li:nth-child(2) {
  background: rgba(192, 192, 192, 0.1);
  border: 1px solid rgba(192, 192, 192, 0.25);
  color: #e0e0e0;
}
.tetris-leaderboard li:nth-child(3) {
  background: rgba(205, 127, 50, 0.1);
  border: 1px solid rgba(205, 127, 50, 0.25);
  color: #cd7f32;
}
.tetris-leaderboard li::before {
  counter-increment: rank;
  content: counter(rank) ".";
  margin-right: 8px;
  min-width: 18px;
  font-weight: bold;
}
.tetris-leaderboard-empty {
  text-align: center;
  color: #7a7585;
  font-style: italic;
}

.tetris-modal {
  position: fixed;
  inset: 0;
  background: rgba(9, 6, 18, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.tetris-modal-content {
  background: #12101a;
  border: 2px solid rgba(158, 231, 255, 0.3);
  border-radius: 14px;
  padding: 24px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.tetris-modal-content h2 {
  color: #fac960;
  font-family: "pfDinText";
  font-size: 24px;
}
.tetris-modal-content p {
  color: #d6d2e0;
  font-family: "pfDinText";
  font-size: 15px;
}
.tetris-modal-content input {
  padding: 10px 14px;
  font-size: 16px;
  font-family: "pfDinText";
  border-radius: 10px;
  border: 1px solid rgba(158, 231, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: #f4efff;
  text-align: center;
  outline: none;
}
.tetris-modal-content input:focus {
  border-color: #9ee7ff;
  box-shadow: 0 0 12px rgba(0, 192, 254, 0.2);
}
.tetris-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

@media (max-width: 960px) {
  .tetris-layout {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "center center"
      "left right";
  }
  .tetris-center {
    grid-area: center;
  }
  .tetris-left {
    grid-area: left;
  }
  .tetris-right {
    grid-area: right;
  }
}

@media (max-width: 640px) {
  .tetris-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "center"
      "left"
      "right";
  }
  .tetris-panel {
    padding: 12px;
  }
  #tetris-canvas {
    max-width: 100%;
    width: 100%;
  }
}