/* ==================== ИГРЫ WINDOWS ==================== */

.games-icons-right {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 1;
  align-items: center;
}

/* ==================== КАРТЫ (общее) ==================== */
.card {
  width: 60px;
  height: 84px;
  background: #fff;
  border: 2px solid #000;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  font-family: "Arial", sans-serif;
  font-weight: bold;
  user-select: none;
  position: absolute;
  left: 0;
  box-shadow: 1px 1px 2px rgba(0,0,0,0.3);
  cursor: pointer;
}
.card.red { color: #d00000; }
.card.black { color: #000; }
.card .card-rank { font-size: 16px; line-height: 1; margin-top: 3px; }
.card .card-suit { font-size: 26px; line-height: 1; }
.card.selected { outline: 3px solid #ffcc00; box-shadow: 0 0 8px #ffcc00; }
.card.back {
  background: repeating-linear-gradient(45deg, #1e5f9e, #1e5f9e 4px, #2b7bc0 4px, #2b7bc0 8px);
  border-color: #0a3d6e;
}
.card.empty {
  background: rgba(255,255,255,0.15);
  border: 2px dashed #808080;
  color: #808080;
  justify-content: center;
  font-size: 32px;
}

/* ==================== КОСЫНКА ==================== */
.sol-top {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}
.sol-pile {
  width: 60px;
  height: 84px;
  border: 2px dashed #808080;
  border-radius: 4px;
  position: relative;
  background: rgba(0,0,0,0.1);
}
.sol-stock {
  background: linear-gradient(135deg, #3a7bd5, #1e5f9e);
  border: 2px solid #0a3d6e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  cursor: pointer;
}
.sol-stock:hover { filter: brightness(1.15); }
.sol-waste, .sol-foundation { background: rgba(255,255,255,0.1); }

.sol-tableau {
  display: flex;
  gap: 8px;
  justify-content: center;
  min-height: 400px;
}
.sol-col {
  width: 60px;
  min-height: 200px;
  position: relative;
  cursor: pointer;
}

/* ==================== FREECELL ==================== */
.fc-top {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}
.fc-free {
  width: 60px;
  height: 84px;
  border: 2px dashed #808080;
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
  position: relative;
}
.fc-foundation { width: 60px; height: 84px; border: 2px dashed #808080; border-radius: 4px; background: rgba(255,255,255,0.1); position: relative; }
.fc-tableau {
  display: flex;
  gap: 8px;
  justify-content: center;
  min-height: 400px;
}
.fc-col { width: 60px; min-height: 200px; position: relative; cursor: pointer; }

/* ==================== ПАУК ==================== */
.sp-tableau {
  display: flex;
  gap: 6px;
  justify-content: center;
  min-height: 400px;
}
.sp-col { width: 56px; min-height: 200px; position: relative; cursor: pointer; }
.sp-col .card { width: 56px; height: 78px; }

/* ==================== ПИНБОЛ ==================== */
.pb-canvas {
  background: #000;
  border: 3px solid #808080;
  display: block;
  margin: 0 auto;
  cursor: none;
}

/* ==================== МОБИЛЬНАЯ ВЕРСИЯ ==================== */
@media (max-width: 640px) {
  /* --- Левые иконки — верхняя строка --- */
  .desktop-icons-left {
    top: 0 !important;
    height: 74px !important;
    background: rgba(0, 0, 0, 0.28) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18) !important;
    z-index: 5 !important;
  }

  /* --- Правые иконки (игры) — вторая строка --- */
  .games-icons-right {
    position: fixed;
    top: 74px;
    right: 0;
    left: 0;
    width: 100%;
    height: 74px;
    flex-direction: row;
    align-items: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 4px;
    padding: 6px 6px 4px 6px;
    background: rgba(0, 0, 0, 0.28);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    z-index: 5;
    justify-content: flex-start;
  }

  .games-icons-right::-webkit-scrollbar { height: 4px; }
  .games-icons-right::-webkit-scrollbar-thumb { background: #c0c0c0; border-radius: 2px; }
  .games-icons-right::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.1); }

  .games-icons-right .desktop-icon {
    width: 58px;
    flex-shrink: 0;
  }
  .games-icons-right .icon-img {
    width: 26px;
    height: 26px;
  }
  .games-icons-right .desktop-icon span {
    font-size: 9px;
    line-height: 1.15;
    padding: 1px 2px;
  }

  /* --- Главное окно сдвигаем ниже двух строк --- */
  .main-window {
    top: 152px !important;
    bottom: 44px !important;
    left: 2vw !important;
    right: 2vw !important;
    height: auto !important;
    max-height: none !important;
  }

  /* --- Игры: карты меньше --- */
  .card, .sol-pile, .fc-free, .fc-foundation { width: 44px; height: 62px; }
  .card .card-rank { font-size: 12px; }
  .card .card-suit { font-size: 18px; }
  .sol-col, .fc-col { width: 44px; }
  .sp-col { width: 42px; }
  .sp-col .card { width: 42px; height: 60px; }

  /* --- Игровые окна — на весь экран --- */
  #solitaireWindow,
  #freecellWindow,
  #spiderWindow {
    width: 96vw !important;
    max-height: calc(100vh - 160px);
  }

  /* Пинбол — канвас уменьшаем, чтобы влез */
  .pb-canvas {
    width: 100% !important;
    max-width: 320px;
    height: auto !important;
  }
}

@media (max-width: 380px) {
  .games-icons-right .desktop-icon { width: 52px; }
  .games-icons-right .icon-img { width: 22px; height: 22px; }
  .games-icons-right .desktop-icon span { font-size: 8px; }
  .card, .sol-pile, .fc-free, .fc-foundation { width: 38px; height: 54px; }
  .card .card-rank { font-size: 10px; }
  .card .card-suit { font-size: 15px; }
  .sol-col, .fc-col { width: 38px; }
  .sp-col { width: 36px; }
  .sp-col .card { width: 36px; height: 52px; }
}