/* ========== Reset & Base ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #faf8f5;
  color: #1e293b;
  min-height: 100vh;
}

/* ========== Menu Page ========== */
.menu-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem;
}

.menu-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.menu-subtitle {
  color: #64748b;
  margin-bottom: 2.5rem;
  font-size: 1.1rem;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 900px;
  width: 100%;
}

.game-card {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(139,92,246,0.15), 0 8px 24px rgba(0,0,0,0.08);
}

.game-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.game-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #8b5cf6;
}

.game-desc {
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.5;
}

.game-badge {
  display: inline-block;
  background: #ede9fe;
  color: #7c3aed;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 1rem;
}

.menu-footer {
  margin-top: 3rem;
  color: #94a3b8;
  font-size: 0.85rem;
}

/* ========== Game Pages (shared) ========== */
.game-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #8b5cf6;
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.back-link:hover {
  text-decoration: underline;
}

.game-heading {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.game-desc {
  color: #64748b;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* ========== Shared Controls ========== */
.card {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
}

.btn-primary {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff;
  border: none;
  padding: 0.75rem 2.5rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.message {
  text-align: center;
  margin: 0.75rem 0;
  padding: 0.75rem;
  border-radius: 10px;
  font-weight: 600;
  display: none;
}

.message.show { display: block; }
.message.info { background: #ede9fe; color: #7c3aed; }
.message.error { background: #fef2f2; color: #dc2626; }
.message.success { background: #ecfdf5; color: #059669; }

@media (max-width: 480px) {
  .menu-title { font-size: 1.6rem; }
  .game-heading { font-size: 1.6rem; }
}
