/* Base game container and layout styles */
.about-container {
  margin: 0 auto;
  text-align: center;
  padding: 2rem;
}

#about-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  justify-content: center;
  flex-direction: column;
  /* align-content: flex-end; */
  flex-wrap: nowrap;
}

.pill-menu {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
  justify-items: center;
  width: 100%;
}

/* Timing variables for pill menu transitions (single source of truth for games styles)
   These are intentionally defined here so pages that include games.css get the
   correct timing even if a dedicated pill-menu.css isn't loaded. */
:root {
  --pill-opacity-duration: 1.5s;
  --pill-maxheight-duration: 1.8s;
  --pill-easing: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Pills navigation styling */
.pill {
  color: white;
  border-radius: 999px;
  border: 0.25rem solid;
  padding: 1rem 2rem;
  font-size: 2rem;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.2s;
  width: 50%;
  align-self: anchor-center;
  font-family: friendly-question;
}

/* Game section colors */
#truths-container .card-front,
.pill[data-target="truths"] {
  background-color: var(--blue-transparent);
  border-color: var(--blue);
}

.pill[data-target="truths"]:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px 4px var(--blue);
}

.pill.disabled {
  background: #222;
  cursor: not-allowed;
  opacity: 0.6;
}

#ou-container .card-front,
.pill[data-target="overrated"] {
  background-color: var(--yellow-transparent);
  border-color: var(--yellow);
}

.pill[data-target="overrated"]:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px 4px var(--yellow);
}

#goodbad-container .card-front,
.pill[data-target="goodbad"] {
  background-color: var(--red-transparent);
  border-color: var(--red);
}

.pill[data-target="goodbad"]:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px 4px var(--red);
}

#wouldyou-container .card-front,
.pill[data-target="wouldyou"] {
  background-color: var(--green-transparent);
  border-color: var(--green);
}

.pill[data-target="wouldyou"]:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px 4px var(--green);
}

.hidden {
  display: none;
}

/* Allow pill-menu sections to stay in the flow so they can animate.
   Global .hidden is used elsewhere; scope the override to .pill-menu only. */
.pill-menu .hidden {
  display: block;
}

/* Ensure collapsed state inside pill-menu uses max-height/opacity so transitions work */
.pill-menu .game-section.hidden {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Card grid layout */
.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: stretch;
  justify-content: center;
  margin: 0;
  margin-top: 1rem;
  padding: 0;
  width: 100%;
}

/* Responsive column counts for cards */
@media (min-width: 50rem) {
  .card-grid .card {
    flex: 0 1 calc(50% - 20px);
    max-width: calc(50% - 20px);
  }
}

@media (min-width: 75rem) {
  .card-grid .card {
    flex: 0 1 calc(33.333% - 20px);
    max-width: calc(33.333% - 20px);
  }
}

@media (max-width: 40rem) {
  .card-grid .card {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

.game-section {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height var(--pill-maxheight-duration) var(--pill-easing),
    opacity var(--pill-opacity-duration) var(--pill-easing);
  will-change: max-height, opacity;
}

.game-section.open {
  opacity: 1;
  max-height: var(--height);
}

/* Specific handling for Two Truths game section */
#game-truths:not(.hidden) {
  max-height: var(--height); /* Ensures proper height for multiple cards */
}

/* Layout classes */
.card-grid-container {
  display: grid;
  gap: 1rem; /* Example gap */
}

.flex-container {
  display: flex;
  gap: 1rem; /* Example gap */
}

.flex-item-grow {
  flex: 1; /* Example for children in flex container */
}

.grid-col-3 {
  grid-template-columns: repeat(3, 1fr); /* Example for 3 equal columns */
}

.width-50-percent {
  width: 50%;
  margin: 0 auto; /* Example for centering */
}
