/* Основные стили */
body {
  background: url(../images//bg.png);
  background-size: 10%;
  margin: 0;
  min-height: 100vh;
  font-family: sans-serif;
  /* Используем CSS‑переменную --scale для корректировки размеров тени */
  -webkit-box-shadow: 0px 0px calc(100px / var(--scale))
    calc(60px / var(--scale)) rgba(0, 0, 0, 0.6) inset;
  -moz-box-shadow: 0px 0px calc(100px / var(--scale)) calc(60px / var(--scale))
    rgba(0, 0, 0, 0.6) inset;
  box-shadow: 0px 0px calc(100px / var(--scale)) calc(60px / var(--scale))
    rgba(0, 0, 0, 0.6) inset;
}

:focus {
  outline: none;
}

.no-select {
  -webkit-user-select: none; /* Chrome/Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE/Edge */
  user-select: none; /* Стандартный синтаксис */
}

.wrapper {
  margin: 0 auto;
  transform-origin: top center;
}

#loading-indicator {
  font-size: 30px;
  margin-left: 5px;
  line-height: 35px;
  align-items: center;
  color: #fff;
  padding: 10px 40px;
  transition: background-color 0.2slinear;
}

/* Главное меню */
#main-menu {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#main-menu::before {
  content: url(../images//topper.png);
  position: absolute;
  z-index: 1000;
  left: 50%;
  transform: translate(-50%, -50%);
}

.main-menu {
  display: flex;
  width: 500px;
  padding: 40px;
  padding-top: 150px;
  border-radius: 10px;
  text-align: center;
  justify-content: center;
}

.big-button {
  font-size: 14px;
  margin-left: 5px;
  line-height: 35px;
  cursor: pointer;
  border-radius: 4px;
  background-color: #5fb056;
  box-shadow: 0 2px 3px 0 rgba(2, 3, 3, 0.15);
  border: none;
  align-items: center;
  color: #fff;
  padding: 10px 40px;
  transition: background-color 0.2s linear;
}

.big-button:hover {
  background-color: #35752e;
  transition: background-color 0.2s linear;
}

/* Контейнер игры – центрируется по горизонтали */
#game {
  width: 1000px;
  height: 600px;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Блок с кнопками управления */
#controls {
  display: flex;
  text-align: center;
  margin-top: 20px;
  margin-bottom: 20px;
}

#controls button {
  display: flex;
  font-size: 14px;
  margin-left: 5px;
  line-height: 35px;
  cursor: pointer;
  border-radius: 4px;
  background-color: #5fb056;
  box-shadow: 0 2px 3px 0 rgba(2, 3, 3, 0.15);
  border: none;
  align-items: center;
  color: #fff;
  padding: 2px 15px;
  transition: background-color 0.2s linear;
}

#controls button:hover {
  background-color: #35752e;
  transition: background-color 0.2s linear;
}

#controls button:disabled {
  background-color: #999999;
  color: #666666;
  cursor: auto;
  transition: background-color 0.2s linear;
}

.stock {
  background-image: url(../images//stock-refresh.png);
  background-repeat: no-repeat;
  background-position: center;
}

/* Блок со стопками */
#piles {
  width: 100%;
  display: flex;
  height: 100%;
  flex-direction: column;
}

/* Верхний ряд (stock, waste, foundations) – центрирование */
#top-row {
  display: flex;
  margin-bottom: 20px;
  justify-content: center;
}

/* Контейнер foundations – с отступом слева */
#foundations {
  display: flex;
  margin-left: 98px;
}

/* Столбец tableau – центрирование */
#tableau {
  display: flex;
  justify-content: center;
  height: 600px;
}

.card-candidate-hint {
  position: relative;
}
.card-candidate-hint::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Замените путь к изображению на нужный вам */
  background: url("../images/hint2.png") no-repeat center center;
  background-size: cover;
  pointer-events: none;
}

.card-hint-tableau {
  position: relative; /* Создаем контекст для псевдоэлемента */
}

.card-hint-tableau::after {
  content: "";
  position: absolute;
  top: 20px; /* Смещение вниз (cardDistance) */
  left: 0;
  width: 100%;
  height: 100%;
  background: url("../images/hint.png") no-repeat center center;
  background-size: cover;
  background-color: rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  pointer-events: none; /* Не блокирует клики и drop-события */
}

/* Когда в стопке есть карты — подсказка располагается с отступом 20px */
.pile:not(:empty) .card-hint-tableau::after {
  top: 20px;
}

/* Когда стопка пуста — отступ 0 */
.pile:empty.card-hint-tableau::after {
  background-color: rgba(0, 0, 0, 0);
  top: 0;
}

.pile:not(:empty) .card-hint-foundation::after {
  background-color: rgba(0, 0, 0, 0.8);
}

.card-hint-foundation {
  position: relative;
}

.card-hint-foundation::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("../images/hint.png") no-repeat center center;
  background-size: cover;
  border-radius: 8px;
  pointer-events: none;
}

/* Когда в стопке есть карты — подсказка располагается с отступом 20px */
.pile:not(:empty) .card-hint-tableau::after {
  top: 20px;
}

/* Когда стопка пуста — отступ 0 */
.pile:empty.card-hint-tableau::after {
  background-color: rgba(0, 0, 0, 0);
  top: 0;
}

/* Стопки (контейнеры для карт) – размеры 88×124px */
.pile {
  width: 88px;
  height: 124px;
  margin-right: 10px;
  border-radius: 5px;
  position: relative;
  /* z-index: 0; добавлено для создания стекового контекста */
  background-color: rgba(0, 0, 0, 0.2);
}

/* Стили для карты */
.card {
  width: 88px;
  height: 124px;
  position: absolute;
  border-radius: 8px;
  /* border: 1px solid #000; */
  font-size: 0;
  user-select: none;
  cursor: default !important;
  background-repeat: no-repeat;
  touch-action: none;
}

/* Лицевая сторона карты */
.card.front {
  background-image: url("../images//cards.png");
  background-size: 1144px 496px;
}

/* Рубашка карты */
.card.back {
  background-image: url("../images//card-back.png");
  background-size: cover;
}

/* Эффект перетаскивания */
.dragging {
  opacity: 1;
}

/* Оверлеи */
.overlay-wrapper {
  background: rgba(0, 0, 0, 0.7);
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  z-index: 10;
}

#win-overlay,
#no-moves-overlay,
#no-hint-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
}

#win-message,
#no-moves-message,
#no-hint-message {
  background: #fff;
  padding: 40px;
  margin: 40px;
  border-radius: 10px;
  text-align: center;
}

#win-message h2,
#no-moves-message h2 {
  margin-bottom: 20px;
  font-size: 28px;
}

#win-message button,
#no-moves-message button {
  font-size: 20px;
  padding: 10px 20px;
  cursor: pointer;
}

.hint {
  outline: 3px solid yellow;
}
