* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Prevent temporary scrollbars while allowing smooth 3D depth */
html, body {
  height: 100vh;
  overflow: hidden;
  contain: paint;
}

body {
  background-color: #0b1120; /* Deep Navy Background */
  color: #f8fafc;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* 4x3 Grid Layout */
.grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 1350px;
  height: calc(100vh - 40px);
}

/* Responsive fallbacks */
@media (max-width: 900px) {
  html, body {
    overflow: auto;
    contain: none;
  }
  .grid-container {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    height: auto;
  }
}

@media (max-width: 500px) {
  .grid-container {
    grid-template-columns: 1fr;
  }
}

/* 3D Flip Card Container */
.card {
  perspective: 1000px;
  cursor: pointer;
  /* No overflow: hidden here so 3D depth renders cleanly */
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.card.is-flipped .card-inner {
  transform: rotateY(180deg);
}

/* Card Front & Back Base Styles */
.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

/* --- Navy Blue Front Face --- */
.card-front {
  background: #1e293b; /* Navy Blue */
  border: 2px solid #334155;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 20px 16px;
  text-align: center;
}

/* 1. Title (Top & Largest Font) */
.card-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #818cf8;
  line-height: 1.2;
}

/* 2. Description */
.card-desc {
  font-size: 1.15rem;
  font-weight: 500;
  color: #e2e8f0;
  line-height: 1.35;
  margin: auto 0;
}

/* 3. Points (Bottom) */
.card-points {
  font-size: 1.25rem;
  font-weight: 700;
  color: #a3e635; /* Military Green Accent */
  background: rgba(163, 230, 53, 0.12);
  border: 1px solid rgba(163, 230, 53, 0.3);
  padding: 6px 16px;
  border-radius: 20px;
  white-space: nowrap;
}

/* --- Military Green Back Face --- */
.card-back {
  background: #3f4d34; /* Base Military Green */
  border: 2px solid #556b46;
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-icon {
  width: 52px;
  height: 52px;
  stroke: #f1f5f9;
}
