* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: Arial, Helvetica, sans-serif;
  background: #4a120f url('immagini/GameINN logo.png') center/cover no-repeat fixed;
  color: #f8fafc;
}

.container {
  width: min(1100px, calc(100% - 2rem));
  background: rgba(36, 11, 14, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(1.5px);
}

.home-container {
  position: relative;
  max-width: 700px;
  text-align: center;
  overflow: hidden;
}

.home-container > * {
  position: relative;
  z-index: 1;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
}

p {
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
  color: #dbeafe;
}

.slider-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin: 2rem 0 1rem;
}

.toggle-group {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.toggle-btn {
  flex: 1 1 0;
  min-width: 0;
  background: #64748b;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.8rem 1.2rem;
}

.toggle-btn.active {
  background: #facc15;
  color: #111827;
  box-shadow: 0 10px 20px rgba(250, 204, 21, 0.35);
}

#playersRange {
  width: 100%;
  accent-color: #facc15;
}

.value-box {
  min-width: 70px;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 1.1rem;
  font-weight: 700;
}

button {
  border: none;
  border-radius: 999px;
  background: #facc15;
  color: #111827;
  padding: 0.85rem 1.4rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(250, 204, 21, 0.35);
}

.home-actions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

#showAllGamesBtn {
  justify-self: start;
  background: linear-gradient(180deg, #9aa862 0%, #6d7f2c 100%);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(109, 127, 44, 0.35);
}

#confirmBtn {
  justify-self: center;
  border-radius: 18% 82% 22% 78% / 78% 18% 82% 22%;
  width: 5.2rem;
  height: 5.2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  line-height: 1;
  text-align: center;
  transform: scale(1.06);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.game-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  overflow: hidden;
  min-height: 100%;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 0;
  color: #f8fafc;
}

.game-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.card-content {
  padding: 1rem;
}

.tag {
  display: inline-block;
  margin-bottom: 0.6rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.2);
  color: #fef3c7;
  font-size: 0.8rem;
  font-weight: 700;
}

.card-content h3 {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
}

.card-content p {
  margin: 0;
  color: #dbeafe;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: #facc15;
  text-decoration: none;
  font-weight: 700;
}

.no-games {
  margin-top: 1rem;
  text-align: center;
  color: #fca5a5;
}

.details-card {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(0, 1.4fr);
  gap: 2rem;
  align-items: center;
}

.details-card img {
  width: 100%;
  border-radius: 18px;
  min-height: 280px;
  object-fit: cover;
}

.details-content h1 {
  margin-bottom: 0.8rem;
}

.details-link {
  display: inline-block;
  margin-top: 1rem;
  color: #facc15;
  font-weight: 700;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 600px) {
  .slider-wrap {
    flex-direction: column;
  }

  .value-box {
    width: 100%;
    text-align: center;
  }

  .details-card {
    grid-template-columns: 1fr;
  }
}
