@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@400;700&display=swap');

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

body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100dvh;
  color: #fff;
}

@supports not (min-height: 100dvh) {
  body { min-height: 100vh; }
}

header {
  text-align: center;
  padding: 2rem 1rem 1rem;
}

header h1 {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(2rem, 8vw, 3.5rem);
  text-shadow: 3px 3px 0 rgba(0,0,0,0.2);
  letter-spacing: 2px;
}

.subtitle {
  font-size: clamp(1rem, 3.5vw, 1.3rem);
  opacity: 0.9;
  margin-top: 0.3rem;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, calc(100vw - 2rem)), 1fr));
  gap: 1rem;
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 600px) {
  .game-grid {
    gap: 1.5rem;
    padding: 2rem;
  }
}

.game-card {
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255,255,255,0.2);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.game-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  border-color: rgba(255,255,255,0.5);
}

@media (pointer: coarse) {
  .game-card:hover {
    transform: none;
    box-shadow: none;
  }
  .game-card:active {
    transform: scale(0.98);
    border-color: rgba(255,255,255,0.5);
  }
}

.game-card img {
  width: 100%;
  height: clamp(140px, 30vw, 200px);
  object-fit: cover;
  background: rgba(0,0,0,0.2);
}

.card-img-placeholder {
  width: 100%;
  height: clamp(140px, 30vw, 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff6b6b, #ffa726);
  font-family: 'Fredoka One', cursive;
  font-size: 4rem;
  color: rgba(255,255,255,0.7);
}

.game-card .card-body {
  padding: 1rem 1.2rem 1.2rem;
}

.game-card h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
}

.game-card p {
  font-size: 0.95rem;
  opacity: 0.85;
  line-height: 1.4;
}

.game-card .tags {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.game-card .tag {
  background: rgba(255,255,255,0.2);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.loading {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 1.3rem;
  padding: 3rem;
  opacity: 0.7;
}

.no-games {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
}

.no-games h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.play-btn {
  display: inline-block;
  margin-top: 0.8rem;
  background: #ff6b6b;
  color: white;
  border: none;
  padding: 0.6rem 1.8rem;
  border-radius: 999px;
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.2);
  min-height: 44px;
  min-width: 44px;
}

.version-info {
  text-align: center;
  padding: 1rem;
  opacity: 0.6;
  font-size: 0.8rem;
  font-family: monospace;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
