/* ========================================
   MathLamb — Page d'accueil
   ======================================== */

:root {
  --ocre: #D4A843;
  --terracotta: #C75B39;
  --vert-foret: #2D6A4F;
  --bleu-ciel: #87CEEB;
  --creme: #FFF8F0;
  --texte: #2C1810;
  --blanc: #FFFFFF;
}

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

body {
  font-family: 'Nunito', sans-serif;
  background-color: var(--creme);
  color: var(--texte);
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Background Pattern --- */
.home-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 2rem 1rem;
}

.pattern-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.06;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 40px,
      var(--terracotta) 40px,
      var(--terracotta) 41px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 40px,
      var(--ocre) 40px,
      var(--ocre) 41px
    ),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 56px,
      var(--vert-foret) 56px,
      var(--vert-foret) 57px
    );
}

/* --- Header / Logo --- */
.home-header {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.rope-icon {
  width: 140px;
  height: 50px;
  animation: swingRope 3s ease-in-out infinite;
}

@keyframes swingRope {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

.game-title {
  font-family: 'Baloo 2', cursive;
  font-size: 3rem;
  font-weight: 800;
  color: var(--terracotta);
  text-shadow: 2px 2px 0 var(--ocre);
  line-height: 1.1;
}

.game-subtitle {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--vert-foret);
  margin-top: 0.25rem;
}

/* --- Main Area --- */
.home-main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
}

/* --- Game Selection --- */
.game-selection {
  text-align: center;
}

.game-selection h2 {
  font-family: 'Baloo 2', cursive;
  font-size: 1.4rem;
  color: var(--texte);
  margin-bottom: 1.25rem;
}

.game-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.game-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

.game-card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.5rem 1rem;
  border-radius: 16px;
  border: 3px solid #e0d5c5;
  background: var(--blanc);
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.game-card:hover .game-card-content {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.game-card:active .game-card-content {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.game-card-math:hover .game-card-content,
.game-card-math:active .game-card-content {
  border-color: var(--vert-foret);
  background: rgba(45, 106, 79, 0.06);
}

.game-card-orthographe:hover .game-card-content,
.game-card-orthographe:active .game-card-content {
  border-color: var(--ocre);
  background: rgba(212, 168, 67, 0.06);
}

.game-card-memoire:hover .game-card-content,
.game-card-memoire:active .game-card-content {
  border-color: var(--bleu-ciel);
  background: rgba(135, 206, 235, 0.06);
}

.game-card-logique:hover .game-card-content,
.game-card-logique:active .game-card-content {
  border-color: var(--terracotta);
  background: rgba(199, 91, 57, 0.06);
}

.game-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
}

.game-card-icon svg {
  width: 100%;
  height: 100%;
}

.game-card-name {
  font-family: 'Baloo 2', cursive;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--texte);
}

.game-card-desc {
  font-size: 0.8rem;
  color: #8a7a6a;
  text-align: center;
  line-height: 1.3;
}

/* --- Footer --- */
.home-footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: #8a7a6a;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .game-title {
    font-size: 2.2rem;
  }

  .game-subtitle {
    font-size: 1rem;
  }

  .game-cards {
    gap: 0.75rem;
  }

  .game-card-content {
    padding: 1.2rem 0.75rem;
  }
}
